如何在Windows上捕获Python中的SIGINT?
发布时间:2020-12-13 22:33:57 所属栏目:Windows 来源:网络整理
导读:(与 this question相似) 在Python 2.7下的UNIX上,在Python提示符下: import signal def handler(signal,frame): ... print 'welcome to the handler' ... signal.signal(signal.SIGINT,handler) built-in function default_int_handler 我按ctrl-c welcome
(与
this question相似)
在Python 2.7下的UNIX上,在Python提示符下: >>> import signal >>> def handler(signal,frame): ... print 'welcome to the handler' ... >>> signal.signal(signal.SIGINT,handler) <built-in function default_int_handler> 我按ctrl-c >>> welcome to the handler >>> 在Windows上: >>> import signal >>> def handler(signal,handler) <built-in function default_int_handler> 按ctrl-c: >>> KeyboardInterrupt >>> 我可以验证处理程序是否正在安装Python端作为SIGINT的处理程序(调用signal.signal第二个计时器返回我的处理程序).如何在Windows上捕获SIGINT? 解决方法
在上游打开
the bug后,找到了问题的根本原因并编写了补丁.这个补丁不会进入python 2.x系列.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 什么GUI工具包最适合Windows和Linux中的本地LAF for Python
- .net – 对于由Microsoft创建的类,“1”或“2”后缀是什么意
- Windows数据包嗅探器
- windows-7 – Windows 7无法连接到Samba
- windows-server-2008-r2 – 模拟服务帐户
- 注册 – 如何注册Windows Phone 8?什么是Windows Phone IP
- windows-installer – 如何强制使用spcified语言安装MSI
- Windows Azure WebRole中的PHP53_via_FastCGI错误0xc000000
- windows-vista – Windows中的OS.symlink支持
- 为什么我的编辑控件在我的win32 c应用程序中看起来很奇怪而
推荐文章
站长推荐
热点阅读