Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getch():
- import sys, tty, termios
- fd = sys.stdin.fileno()
- old = termios.tcgetattr(fd)
- try:
- tty.setraw(fd)
- return sys.stdin.read(1)
- finally:
- termios.tcsetattr(fd, termios.TCSADRAIN, old)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement