Portable getch() for Python.
More than a few times, I'd like to just write
getch() instead of
This is the missing cross-platform functionality you've been looking for.
I don't anticipate this to be used in any major projects. Rather, installed
globally and used in those one-off scripts that you'd like to have just a bit
more professionalism with. Using
raw_input for single-key capture and pause
mechanism makes a hacked-together script feel even more like just that.
Install with pip:
$ pip install py-getch
from getch import getch, pause key = getch() print 'You pressed:', key pause()
Works like you'd expect, except that it returns a string.
pause(message='Press any key to continue. . . ')
For proper pause functionality.