Original Post
I've got a program in Python that binds keypress events to a function. Inside this function, if the key pressed is a certain key, then I use os.system() to run another program. This program can take up to 15 seconds before the user sees anything different on the screen, during which time the user might assume that the keypress didn't register and so hit the key again. If this happens, then when the program called from os.system() exits, my program sees the second keypress and passes it along to my binded method, resulting in another os.system() call. Is there a command to clear keypresses or something similar which I can use to prevent os.system() from executing a second time? I've tried setting a flag as the first thing in the block for this key which will cause my binded method to exit right away if the flag is set. I've also tried using the unbind method to disable my key processing method and then rebinding when the called program terminates. Niether of these work.