Wait for a keypress before continuing?

John Doe jdoe at usenetlove.invalid
Tue Aug 16 22:16:57 CEST 2011


def wait_for_keystroke():
  char=0
  while not (char==chr(27) or char==chr(110)):
    char=msvcrt.getch()
    if char==0:
      return

That freezes the process.
That means char=msvcrt.getch() is getting something?
Could it have something to do with the formatting of the character?



More information about the Python-list mailing list