在远程桌面上使用 PyAutoGUI 时出现鼠标单击问题
Mouse click trouble with the use of PyAutoGUI on a remote desktop
我在工作中有一些无聊的重复性任务。
我使用远程桌面,这样他们就可以 运行 在晚上等等。
但是我在远程桌面上单击鼠标时遇到问题。当我通过我的笔记本电脑连接时,脚本工作正常。但是当我没有连接时,我从 PyAutoGUI 收到这个错误消息:
'PyAutoGUI fail-safe triggered from mouse moving to a corner of the screen'
当鼠标在屏幕上不可见时会出现此错误。
知道如何解决这个问题吗?
根据所有者的说法,这是不支持的。他在与这个主题相关的回购中收集了所有问题 here. There is even an issue 打开描述了一个非常相似的情况。
但是,此 comment 描述了可以解决此问题的技巧。我还没有尝试过,但看起来很有希望。它说:
Use a remote desktop client that allows you to keep outputting the
display, even if you minimise the window/close your PC. I used
terminals (https://github.com/Terminals-Origin/Terminals - not affiliated with them
at all just recommending as it solved this issue for me).You can set
this up to persist the display, and your code should then run fine.
注意:我已经更新了提供的link。
我在工作中有一些无聊的重复性任务。 我使用远程桌面,这样他们就可以 运行 在晚上等等。
但是我在远程桌面上单击鼠标时遇到问题。当我通过我的笔记本电脑连接时,脚本工作正常。但是当我没有连接时,我从 PyAutoGUI 收到这个错误消息: 'PyAutoGUI fail-safe triggered from mouse moving to a corner of the screen'
当鼠标在屏幕上不可见时会出现此错误。
知道如何解决这个问题吗?
根据所有者的说法,这是不支持的。他在与这个主题相关的回购中收集了所有问题 here. There is even an issue 打开描述了一个非常相似的情况。
但是,此 comment 描述了可以解决此问题的技巧。我还没有尝试过,但看起来很有希望。它说:
Use a remote desktop client that allows you to keep outputting the display, even if you minimise the window/close your PC. I used terminals (https://github.com/Terminals-Origin/Terminals - not affiliated with them at all just recommending as it solved this issue for me).You can set this up to persist the display, and your code should then run fine.
注意:我已经更新了提供的link。