即使我在Cygwin中运行python脚本,Python信号似乎也无法在Windows上运行。我得到了AttributeError: 'module' object has no attribute SIGALRM
有没有办法在Windows上解决这个问题。我只是在http://docs.python.org/2/library/signal.html
的末尾运行示例答案 0 :(得分:6)
SIGALRM
在Windows中不起作用。来自documentation:
在Windows上,只能使用SIGABRT,SIGFPE,SIGILL,SIGINT,SIGSEGV或SIGTERM调用signal()。在任何其他情况下都会引发ValueError。
This question解决了在Windows中获取SIGALRM
等效主题的问题。 this question也是类似的。