Listening to keyboard input?

T

tjland

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


When you see the net take the shot
When you miss your shot shoot again
When you make your shot you win!

Just remember
Offense sells tickets
But defense wins championships!
 
M

Michael Hudson

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
 

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

Similar Threads


Members online

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top