Thanks, anyway, but these all require Windows (pyHook is Windows-only) and I'm on Mac OS X (10.4.11)
Apparently this is harder in Python than I anticipated. That is, there's no built-in Python word that, unlike «input()» or «raw_input()», will look at the input stream from the keyboard to see if there is anything there without interrupting the program execution and 'waiting' till the user hits a Return or Enter key.
...
User Profile
Collapse
-
Capturing keystrokes during program execution
Is this hard?
I am introducing Python to my students and want to make a simple, interactive program that will, while it's running, 'listen' for any keyboard events. That is, I don't want to include an 'input' statement - that would pause execution till someone answered. I just want it to keep running, say, printing an 'a' on the screen every 10 seconds, until the user types a 'b'. Then printing a 'b' every 10 seconds till the user... -
Help. Maybe?
Hi.
I'm also trying to figure out how to use Python - there are some nice books out there, but finding a Class is harder. And asking a book can be pretty frustrating. (Even asking a person can be tough...)
If writing the Python code was the easy part, then this reply will probably be pretty useless. I don't know VB, nor even how to make a python module into an applet or standalone app....Leave a comment:
No activity results to display
Show More
Leave a comment: