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 types in some other character...
It seems that this should not be hard; something with sys.stdin, perhaps. The hours I've spent on it are getting embarrassing.
I've fooled around with it and looked though books and the only solution I've come up with was to import pygame.py and use its event handling. This seems like massive overkill for what should be an easy matter.
I'm using IDLE with MacPython 2.5.1 on Mac OS 10.4.11
Thanks for any help on this problem.