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

Keyboard input 2
Sobig in list? 0
What had been going on with the list? 0
Tkinter? 2
decoding keyboard input when using curses 6
What has been going on? 2
Virus in list! 0
Python Input from keyboard 3

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top