我正在尝试设置一个函数超时,但是,我无法成功。
我从https://docs.python.org/3/library/signal.html?highlight=signal%20sigalrm#example运行一个示例代码
但是,我得到了AttributeError。
我在Windows10上使用python3.6.3
这是我的密码。
\>>> import signal
\>>> signal.SIGALRM
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'signal' has no attribute 'SIGALRM'发布于 2018-01-19 08:12:58
Windows不支持SIGALRM。Windows上的https://docs.python.org/2/library/signal.html,signal()只能用SIGABRT、SIGFPE、SIGILL、SIGINT、SIGSEGV或SIGTERM调用。在任何其他情况下都会引发ValueError。
https://stackoverflow.com/questions/47545002
复制相似问题