getch ()
Read a keypress and return the resulting character. Nothing is echoed to the console. This call will block if a keypress is not already available, but will not wait for Enter to be pressed. If the pressed key was a special function key, this will return '\000' or '\xe0'; the next call will return the keycode. The Control-C keypress cannot be read with this function.
ich dachte dass das bedeutet dass getch() wartet (='block'), bis eine Taste gedrückt wird? Also dass das folgende:
Code: Alles auswählen
import msvcrt
ch = msvcrt.getch()
print ch
Das hier:
Code: Alles auswählen
import msvcrt
ch = ""
while ch != "x":
ch = msvcrt.getch()
print ch