Wait for a keypress before continuing?

John Doe jdoe at usenetlove.invalid
Tue Aug 16 14:42:52 EDT 2011


def wait_for_keystroke():
  char=0
  while not char==0x1B:
    char=msvcrt.getch()

That freezes the process. Am I using the right code for the escape 
key, or doing anything else wrong?

Again, I know it could be my system. But I must find a way to do this 
from within Windows. I use a keyboard hook written in C++, maybe 
something from that would be useful, but maybe complex.

Thanks.



More information about the Python-list mailing list