gpt4 book ai didi

Python 信号甚至在 Cygwin 上也不起作用?

转载 作者:可可西里 更新时间:2023-11-01 13:57:50 25 4
gpt4 key购买 nike

即使我在 Cygwin 中运行 python 脚本,Python 信号似乎也无法在 Windows 上运行。我得到了 AttributeError: 'module' object has no attribute SIGALRM

有没有办法在 Windows 上解决这个问题。我只是运行 http://docs.python.org/2/library/signal.html 末尾的示例

最佳答案

SIGALRM 在 Windows 中不起作用。来自documentation :

On Windows, signal() can only be called with SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, or SIGTERM. A ValueError will be raised in any other case.

This question解决了在 Windows 中获取等效 SIGALRM 的主题。和 this question也是类似的。

关于Python 信号甚至在 Cygwin 上也不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16371421/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com