Listening for a Keypress (Console, not GUI)

brettk at gmail.com brettk at gmail.com
Thu Jun 23 19:40:15 EDT 2005


Hello All,

I've written a small daemon that monitors a pop3 mailbox and downloads
any new messages.  It's run from the console in windows, and instead of
having it print something each time it gets a message or writes a file,
i'd like to store those values as internal variables and print them to
the screen whenever the user wants to see them.

So, my question is, using a regular console, is there a way I can get
python to listen for a specific keystroke?  I'm using signal handling
to deal with ^C, could I also do something like that?

TIA




More information about the Python-list mailing list