PyScripter - 无法终止使用 KeyboardInterrupt 运行
我编写了很多我使用的小应用程序,
try:
print "always does this until I Ctrl+C"
Except KeyboardInterrupt:
print "finish program"
我刚刚开始放弃使用 IDLE 并启动 PyScripter。但是 CTRL+C 不再起作用。使用内置解释器时是否仍然可以发送KeyboardInterrupt
?
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 to still send in a KeyboardInterrupt
while using the built-in interpreter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 PyScripter 中,如果您只想终止正在运行的程序,您可以随时重新初始化远程引擎:
来源,Psyscripter 作者
In PyScripter if you just want to terminate a running program you can always re-initialize the remote engine:
Source, Psyscripter Author
我一直在回答我自己的问题,但我相信它们是有效的。PyScripter
google 小组有一种实现,他们导入进度条并杀死它,模拟中断。然而,这与键盘中断不同。看来在新的实施之前我运气不好。
话虽如此,任何人都可以建议另一种新颖的方式来由用户自行决定终止程序(不使用线程:p)吗?
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)?