def getch(): import os if os.name == 'nt': import msvcrt return msvcrt.getch() else: # What >>18 said.