Listening for a Keypress (Console, not GUI)

B

brettk

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
 
B

brettk

Ok, I should really read my messages more carefully before posting, I
apologize.

This is what i'm envisioning

"Python Mail Service is running..."
<user presses S or something>

Status is printed like:

"Current Statistics"
Messages retrieved : 12345
Errors: 123
Total Files Written: 12345

Like that - again, apologies for my lack of detail in the first message
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top