仅在python脚本中写入“导入”会破坏我的鼠标光标,从而导致硬重置 [英] Just writing 'import' in a python script breaks my mouse cursor forcing a hard reset

查看:266
本文介绍了仅在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-changing-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

b
$ b

或包含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脚本中写入“导入”会破坏我的鼠标光标,从而导致硬重置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆