Discuss While with responses to keyboard in the Python Programming forum on Dev Shed. While with responses to keyboard Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
Time spent in forums: 56 m 7 sec
Reputation Power: 0
While with responses to keyboard
I'm a rather inexperienced python programmer. I'm looking for some construct that will start an indefinite loop (eg. while True or something similar) and the program will respond to the keyboard events. Something rather simple: q - get out of the loop and quit, 1 - do something, 2 - do something.
if key == "1":
else if key == "2":
Thanking you all.
I think it is called event driven programming. I can't find anything relevant. It's all about Twisted which looks like has a lot of opponents. Could you recommend something? I don't need/want GUI and I'd like something different than "input" where you need to press enter after the user input.