Gets a single character from standard input. Does not echo to the screen.
| 1 | class Getch: |
| 2 | """ |
| 3 | Gets a single character from standard input. Does not echo to |
| 4 | the screen. |
| 5 | """ |
| 6 | |
| 7 | def __init__(self): |
| 8 | try: |
| 9 | self.impl = _GetchWindows() |
| 10 | except ImportError: |
| 11 | try: |
| 12 | self.impl = _GetchMacCarbon() |
| 13 | except(AttributeError, ImportError): |
| 14 | self.impl = _GetchUnix() |
| 15 | |
| 16 | def __call__(self): return self.impl() |
| 17 | |
| 18 | |
| 19 | class _GetchUnix: |