Just writing #39;import#39; in a python script breaks my mouse cursor forcing a hard reset(只是在 python 脚本中写“导入会破坏我的鼠标光标,强制进行硬重置)
问题描述
我对此完全感到困惑.. 尝试在我的 Debian Stretch 系统上编写 python 脚本,但在运行 4 行脚本后,我的鼠标光标会变成十字并阻止任何点击操作,并迫使我努力按住关闭按钮重置系统!
I'm totally baffled by this.. Trying to code a python script on my Debian Stretch system but after running a 4 lined script my mouse cursor would turn into a cross and blocking any click actions from working and forcing me to hard reset the system by holding the off button!
我测试了几次,发现我的脚本只需要包含一个导入就可以破坏它,没有别的 - 字面意思是单行:
I tested a few times and found out that my script just needs to contain an import for it to break, nothing else - literally a one-lined:
import pxssh
然后运行
./bug.py
系统坏了.鼠标光标看起来像一个十字,不能点击任何地方.需要硬重置.
System broken. Mouse cursor looks like a cross and cannot click anywhere. Hard reset required.
我发现其他人似乎有完全相同的问题,有一张上传的图片,但我不知道是否是 python 为他/她造成的.https://askubuntu.com/questions/918261/why-does-my-cursor-keep-chang-to-a-black-cross-and-how-do-i-revert-it
I found someone else with what appears to be the exact same issue, there's an uploaded image of it but I don't know if it was python causing it for him/her. https://askubuntu.com/questions/918261/why-does-my-cursor-keep-changing-to-a-black-cross-and-how-do-i-revert-it
如果我使用我的键盘并再次重新运行它,我会收到此错误:
If I use my keyboard and re-run it again, I get this error:
import-im6.q16: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9182.
推荐答案
你没有运行 Python!您不小心将其作为 shell 脚本运行.运行它
You're not running Python! You're accidentally running this as a shell script. Run it as
python bug.py
或包括 shebang 行:
or include the shebang line:
#!/usr/bin/env python
目前,您似乎正在运行一个 完全不相关的程序,名为 import
,专为截屏而设计.
Currently, you seem to be running a completely unrelated program named import
, designed for screen capture.
这篇关于只是在 python 脚本中写“导入"会破坏我的鼠标光标,强制进行硬重置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:只是在 python 脚本中写“导入"会破坏我的鼠标光标,强制进行硬重置


基础教程推荐
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 包装空间模型 2022-01-01