只是在 python 脚本中写“导入"会破坏我的鼠标光标,强制进行硬重置

2023-11-08Python开发问题
1

本文介绍了只是在 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 脚本中写“导入"会破坏我的鼠标光标,强制进行硬重置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

在xarray中按单个维度的多个坐标分组
groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)...
2024-08-22 Python开发问题
15

Pandas中的GROUP BY AND SUM不丢失列
Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)...
2024-08-22 Python开发问题
17

pandas 有从特定日期开始的按月分组的方式吗?
Is there a way of group by month in Pandas starting at specific day number?( pandas 有从特定日期开始的按月分组的方式吗?)...
2024-08-22 Python开发问题
10

GROUP BY+新列+基于条件的前一行抓取值
Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)...
2024-08-22 Python开发问题
18

PANDA中的Groupby算法和插值算法
Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)...
2024-08-22 Python开发问题
11

PANAS-基于列对行进行分组,并将NaN替换为非空值
Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)...
2024-08-22 Python开发问题
10