I write alot of small apps where I use
try:
print "always does this until I Ctrl+C"
Except KeyboardInterrupt:
print "finish program"
I've just began to move away from using IDLE and booted up PyScripter. However CTRL+C no longer works. Is it possible t开发者_如何学JAVAo still send in a KeyboardInterrupt
while using the built-in interpreter?
In PyScripter if you just want to terminate a running program you can always re-initialize the remote engine:
- Application Run Menu > Python Engine > Reinitialize Python Engine or
- Interpreter context menu > Python Engine > Reinitialize Python Engine or
- Keyboard shortcut CTRL-F2
Source, Psyscripter Author
I keep answering my own questions, but I believe they are valid..
The PyScripter google group has one implementation where they import a progress bar and kill it, simulating an interrupt. however, this is not the same as a keyboard interrupt. Looks like i'm out of luck until a new implementation.
Having Said That, can anyone suggest another novel way to terminate programs at a user's discretion (without using threads :p)?
精彩评论