Hi Dick, I'll move my replies back into the public discussion...
> while answer == "": > c = 0 > timeStart = time.time() > while True: > c += 1 > if msvcrt.kbhit(): > if msvcrt.getch() == ' ': > break > if msvcrt.kbhit(): > if msvcrt.getch() == 'h': > print "Hello" > if msvcrt.kbhit(): > if msvcrt.getch() == 'q': > answer = "quit" You only need one kbhit to tell you if any key has been hit at all. Then you can use getch to fetch that key and store it in a variable. Then the code above turns into: while True: if kbhit(): key = getch() if key == ' ': break elif key == 'h': print 'hello' elif key == 'q': answer = 'quit' Does that make sense? Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor