Listening to keyboard input?

Michael Hudson mwh at python.net
Tue Aug 26 09:49:00 EDT 2003


tjland at iserv.net writes:

> Can python monitor keyboard input for lets say i want to have my program
> return to the main menu when the user hits escape! Can python do this or
> am i going to have to embed some c++ program into it? Thanx

Um, probably.  Questions like what platform you're on become relavent.
If Unix, look at termios, os.read, etc.  Or just use curses.  On
windows, I'm told that the msvcrt module is useful but I don't use
windows & wouldn't really know.

Punctuation is nice.  More please.

Cheers,
mwh

-- 
  how am I expected to quit smoking if I have to deal with NT
  every day                                                -- Ben Raia




More information about the Python-list mailing list