As a safety feature, a fail-safe feature is enabled by default. When a
PyAutoGUI function is called, if the mouse is in any of the four
corners of the primary monitor, they will raise a
pyautogui.FailSafeException. There is a one-tenth second delay after
calling every PyAutoGUI functions to give the user time to slam the
mouse into a corner to trigger the fail safe.
从PyAutoGUI看起来您可以配置故障保护
默认情况下,故障保护似乎已启用。验证
pyautogui.FAILSAFE == True
在代码中:尝试将
KeyboardInterrupt
更改为pyautogui.FailSafeException
运行时:在程序调用
.1s
函数的pyautogui
范围内,将鼠标移动到屏幕的一角。我希望这会触发你的sys.exit(0)
相关问题 更多 >
编程相关推荐