# File: msvcrt-example-2.py import msvcrt import time print "press SPACE to enter the serial number" while not msvcrt.kbhit() or msvcrt.getch() != " ": # do something else while we're waiting print ".", time.sleep(0.1) print # clear the keyboard buffer while msvcrt.kbhit(): msvcrt.getch() serial = raw_input("enter your serial number: ") print "serial number is", serial