Changeset 180 for trunk/Target/TargetPython.pas
- Timestamp:
- Aug 26, 2024, 9:15:43 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Target/TargetPython.pas
r161 r180 59 59 60 60 AddLine('# ' + ProgramName); 61 AddLine ('');61 AddLine; 62 62 AddLine('class _Getch:'); 63 63 AddLine(' """Gets a single character from standard input. Does not echo to the screen."""'); … … 67 67 AddLine(' except ImportError:'); 68 68 AddLine(' self.impl = _GetchUnix()'); 69 AddLine ('');69 AddLine; 70 70 AddLine(' def __call__(self): return self.impl()'); 71 AddLine ('');72 AddLine ('');71 AddLine; 72 AddLine; 73 73 AddLine('class _GetchUnix:'); 74 74 AddLine(' def __init__(self):'); 75 75 AddLine(' import tty, sys'); 76 AddLine ('');76 AddLine; 77 77 AddLine(' def __call__(self):'); 78 78 AddLine(' import sys, tty, termios'); … … 85 85 AddLine(' termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)'); 86 86 AddLine(' return ch'); 87 AddLine ('');88 AddLine ('');87 AddLine; 88 AddLine; 89 89 AddLine('class _GetchWindows:'); 90 90 AddLine(' def __init__(self):'); 91 91 AddLine(' import msvcrt'); 92 AddLine ('');92 AddLine; 93 93 AddLine(' def __call__(self):'); 94 94 AddLine(' import msvcrt'); 95 95 AddLine(' return msvcrt.getch()'); 96 AddLine ('');96 AddLine; 97 97 AddLine('getchar = _Getch()'); 98 AddLine ('');98 AddLine; 99 99 AddLine('import sys'); 100 100 AddLine('memory = [0] * ' + IntToStr(MemorySize));
Note:
See TracChangeset
for help on using the changeset viewer.