You are not logged in.
Hi,
I'm trying to run a python hot-corners script from here (at the very bottom of that page). Unfortunately I'm presented the following output:
$ /tmp/hot-corners.py
Traceback (most recent call last):
File "/tmp/hot-corners.py", line 6, in <module>
from Xlib import display
File "/usr/lib/python3.3/site-packages/Xlib/display.py", line 20, in <module>
import new
ImportError: No module named 'new'Google brought up some tech talk on how there is no need to "manually" import new and such, but that didn't help me in how I get that script working. Sure I could comment out "import new" in line 20 in /usr/lib/python3.3/site-packages/Xlib/display.py but then I don't know anything about python and I feel like, if that was the solution because importing the module new has become obsolete, then it would've been fixed upstream. And since it isn't, I'm probably missing somethin.
So can anyone help me out?
Offline
There seems to be an error in the Python 3 version of Xlib/display.py. They probably naively converted the old Python 2 version to Python 3.
The "python" executable on Arch is Python 3. Whenever you save a script from the internet you should convert the hashbang to explicitly invoke the correct version of the Python interpreter. In your case, change it to
#! /usr/bin/env python2My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Thanks for the quick reply. Interpreting the script with python2 as you said works fine.
Offline
python-xlib looks quite dead. Hasn't been updated for 4 years and has been testet with python 1.5 to python 2.6, so it won't work in with python3 (hopefully it does with wothon 2.7).
But I don't know if there's an alternative.
Offline