Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.
0
votes
1answer
13 views
Debian, virtualenv, IPython notebook and matplotlib inline plots
I have been using IPython notebook on both OSX and Windows 7 for a while. Now I'm trying to create a minimal system for me to work on Debian 7 (Wheezy). I installed:
LXDE
Python2.7
python-dev
...
0
votes
2answers
69 views
How to get name of Display Manager on Linux? [duplicate]
I want to see Display Manager name (Gnome, KDE etc.) via python or bash script. Is there any command for it as uname? (I try fedora and Debian)
0
votes
2answers
34 views
Recommended way of installing python packages on Arch
What's the recommended way of installing python packages on Arch? Searching for them on the AUR and installing them from there (or create a PKGBUILD file to make a package yourself) or using pip?
I ...
-1
votes
1answer
46 views
Convert SVG to PDF in python [closed]
I am trying to convert an SVG file to PDF in python using the svglib and reportlab packages. Here is the SVG file.
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG ...
2
votes
1answer
43 views
Where are Python dist-packages stored in FreeBSD?
I am trying to find this path on FreeBSD but it is not working: /usr/local/lib/python2.7/dist-packages
This same path is working on Ubuntu.
Can please some tell me where I can find Python ...
3
votes
2answers
60 views
Clearing/modifying previous libnotify notifications?
I have written a script which generates notifications like this:
notify-send -i audio-card "Transferring audio playback to speakers." \
"Audio playback has been transferred to the analog output ...
3
votes
2answers
58 views
Wait for a X window to appear/disappear (in a sane way)
Inside a shell script, I need to wait for a window that has a string on its title to appear, do some action, and then wait for it to disappear, and do some other action.
Until yesterday, I had this ...
2
votes
1answer
36 views
process continous output of synclient
I am using synclient to track the position of finger on the touchpad.
I use the following command.
synclient -m 100 | awk '{print $2,$3}'
This command gives the 'x' and 'y' co-ordinate on the ...
0
votes
0answers
13 views
Mezzanine start up script
I am having a world of pain writing a simple start up script for Mezzanine. Running python manager.py runserver just refuses to demonize using start-stop-daemon. Does anyone know of a such a simple ...
5
votes
4answers
155 views
Hybrid code in shell scripts. Sharing variables
This answer discusses how to run a multi-line Python snippet from the command line in a terminal. I noticed that the answer works great within shell scripts, even with nested indentation, which is ...
3
votes
3answers
34 views
How can you change the process name of Wing IDE from python to something more descriptive
In my process list under Ubuntu (using top/System Monitor) one of the largest memory hogs (200+Mb) was python. I searched a bit for one of my programs to be the cause until I realised this was my ...
1
vote
1answer
63 views
Running 'make test' on an individual module for Python 2.7.4 build
I am working on building Python 2.7.4 on CentOS 6.4. When running the make test step, the test_gdb step fails, and I would like to get some more info as to why.
Build commands I'm running:
...
0
votes
1answer
24 views
Django not installing with pip because of mismatched hash
I have a virtual machine set up with a directory created with virtualenv (env2). I am inside this directory and have it activated and want to instal django 1.4. This is my command:
$ pip install ...
0
votes
1answer
52 views
Can't install python because of zypper conflict
I have a virtual machine I just set up. I'm running a completely fresh install of OpenSUSE (with online updates from yast). At the terminal I tried to run python:
$ python
bash: python: command not ...
0
votes
1answer
46 views
Gajim, gtalk, and logind
Since the Google talk outage earlier this month, I keep not being able to connect using gajim. I tried deleting all the configuration, updated to the latest development version, and tried in different ...
2
votes
1answer
48 views
Can't open Gajim
When I try to open Gajim using terminal on gnome I get the following:
Traceback (most recent call last):
File "gajim.py", line 106, in <module>
import common.configpaths
File ...
1
vote
1answer
104 views
Software Center not opening in Linux Mint
I'm a Linux Mint 14 user. I'm not able to open the software center.
$ software-center
ERROR:root:DebFileApplication import Traceback (most recent call last): File ...
1
vote
1answer
72 views
Safely convert unicode strings to printable characters
I have many HTML files containing mixed unicode strings like \303\243 and printable characters like %s. What I'd like to do is converting the unicode strings into printable characters in a safe way.
...
2
votes
2answers
19 views
Start Repl/CLI in Background and Feed Commands
Lets say the python repl takes a long time to start up, is there a way to start it up in the background so I can create an alias and feed it commands like python-current "command to run".
4
votes
3answers
145 views
Delete XML node containing certain element
I want to remove all Placemarks from a KML file that contain the element <tessellate>. The following block should be wholly removed:
<Placemark>
...
0
votes
1answer
38 views
Accidentally deleted python, python2, python2.7 files from /usr/bin/. Is it possible to recover them? [closed]
I accidentally deleted python, python2, python2.7 files from /usr/bin/. Now yum is also not working.
Is it possible to recover them?
0
votes
1answer
27 views
Can a GTK applet widget be instantiated through dbus?
I just posted this:
#274616: “Simple” gnome applets in Unity - stickynotes
... where I could instantiate a Gnome 2 bonobo applet in a standalone window,
... using ...
2
votes
1answer
36 views
Vim :fold of python code not different to C/C++ code
When I enter the command :fold inside my python code in .py files, Vim inserts the /*{{{*/ and /*}}}*/ tags. They, of course, cannot be parsed by python interpreter.
When I'm in python I would like ...
1
vote
0answers
131 views
avconv/ffmpeg output through /dev/ttyAMA0
I tried to pipe streaming video from video4linux2 webcam connected to a Raspberry Pi through /dev/ttyAMA0 to a computer using an Arduino as a intermediary. First of all, is it possible? Because I was ...
2
votes
3answers
103 views
How can I schedule a python program to run from another python program?
I'm running a Python program on my Linux server, and depending on some external data it has to run again at xx minutes or hours from now.
So let's say it runs at 6 AM, and then it has to run again at ...
1
vote
2answers
145 views
Backup to a synology NAS with bup
I am trying to make a remote backup to my Synology NAS (DSM 4.1) using bup.
I compiled bup on my NAS from source, did there:
BUP_DIR=/volume1/public/Backups/bup bup init
Initialized empty Git ...
0
votes
1answer
33 views
Can't use peewee on Mac OS X Mountain Lion
I am getting an error when I run Python programs that imports peewee:
ImportError: No module named peewee
The same program works fine under Ubuntu 12.04.
I used pip to install peewee, and it ...
1
vote
1answer
76 views
Use tabs for indentation in Python mode
I am using Emacs for Python developement. My team is using Tab indentation, so I must do the same. The problem is that I can't figure out how to make python-mode use tabs instead of spaces. I want ...
0
votes
1answer
29 views
Installing a plugin for quodlibet as a patch
I'm trying to update a plugin for quodlibet. I fetched a .patch file from here.
I navigate into the directory where the plugin is placed
/usr/share/pyshared/quodlibet/plugins/events
and copy in ...
0
votes
1answer
87 views
I want to install a library which requires a python version and, having two installed, finds the wrong one
I want to install a library on my debian machine and it requires a python version above 2.6.6-7. The machine had installed the version 2.5.2-3, so I installed python 2.7.
When I run python -V, the ...
0
votes
0answers
33 views
A simple script to make a desktop version of Nimbuzz WebChat? [closed]
There is a nice little script which uses python-webkit called "RGB/HEX Color Picker" here: http://gnome-look.org/content/show.php?action=content&content=128317
I tried if I can use it to make a ...
0
votes
3answers
141 views
Is shebang always the same as the interpreter's installation directory?
Must the shebang header always match the interpreter's installation directory? If so, then why do both #!/usr/bin/python and #!/usr/local/bin/python work for me?
6
votes
5answers
476 views
How can I have more than one possibility in a script's shebang line?
I'm in a bit of an interesting situation where I have a Python script that can theoretically be run by a variety of users with a variety of environments (and PATHs) and on a variety of Linux systems. ...
1
vote
0answers
58 views
How to resume the ?WATCH command when a USB GPS is reconnected
I have some hacks to ensure that my USB GPS devices continues spitting data if disconnected, then reconnected. The devices are so flaky that they need restarting so as to continue transmitting data.
...
-1
votes
1answer
45 views
Doing regex in python [closed]
I had a directory "/pcap_test" which contains several log files. Each file has a pattern like:
Pkt: 1 (358 bytes), LIFE: 1, App: itunes (INTO), State: TERMINATED, Stack: /ETH/IP/UDP/itunes, Error: ...
1
vote
2answers
83 views
Aliasing 'python' to 'ipython' only when 'python' is run without args
I thought it would be nice to have an alias (in ~/.zshrc) to have 'python' aliased to 'ipython' ONLY when 'python' is run without args (otherwise, programs won't launch).
First of all, how to express ...
1
vote
1answer
163 views
Upgrade matplotlib to 1.2 or 1.3
I am trying to upgrade my python matplotlib but for some reason I can't get it to upgrade.
I originally installed matplotlib with:
apt-get install python-matplotlib
which was fine. However it ...
1
vote
1answer
92 views
Managing the output streams of many subprocesses with deadlocks
I have a Python script that does more or less this
current_tasks = TaskManager()
MAXPROCS = 8
while len(outstanding_tasks) > 0:
if len(current_tasks.running) < MAXPROCS:
...
0
votes
3answers
156 views
apt-get install packages for python2.7
Whenever I install a package for python it only installs for Python2.6 which came with the Debian 6. I am wondering how do I install for python2.7 with apt-get. Presently I am downloading the tarballs ...
2
votes
1answer
66 views
What is the source of truth for currently active tty/pts connections?
I'm looking for a simple way to determine the number of currently logged in users, using only the filesystem and basic bash functions (instead of using binaries).
The uptime binary appears to be ...
0
votes
0answers
22 views
Lots of 'python-console' entries in top
24377 me 20 0 128m 34m 3856 S 0 0.9 0:00.83 python-console
I have about 40 odd entries like this when I run top. I have no python console windows open and rebooted my machine since I ...
2
votes
3answers
198 views
CUPS - check if print successful (either python or in system)
EDIT: I forgot to make it clear I'm using python and pycups. The code is python but I shouldn't have thought that was enough.
I've dug through the cups documentation a few times and couldn't find ...
5
votes
1answer
63 views
Correct handling of Python2 and Python3
What is the correct way running scripts that depend on python2.x but on a system where python3.x is aliased with python.
The solution should take into account the following things :
Python2 ...
2
votes
0answers
33 views
Losing sound after installing wine 1.5 (+python 2.7)?
I have a desktop and a laptop computer. Since I wanted to run IrfanView (that works great now!), I installed wine 1.5.22, which involved installing 1 GB of dependencies. The desktop continues to work ...
1
vote
2answers
57 views
how to install ast python package
I'm using django constance in my project. This app used a python package ast. When I try to install that package using command pip-2.7 install ast, it results as "Could not find any downloads that ...
1
vote
0answers
115 views
Python bindings for libtorrent-rasterbar are not working on debian
I'm running Debian 6.0.6
I've downloaded latest version of libtorrent-rasterbar from here: http://code.google.com/p/libtorrent/downloads/detail?name=libtorrent-rasterbar-0.16.6.tar.gz&can=2 and ...
7
votes
1answer
220 views
Problems running python script from motion
I'm trying to set up the raspberry pi with my webcam as a motion detecting cctv that uploads the videos to google drive using Jeremy Blythe's script
I have motion working correctly and the python ...
1
vote
1answer
42 views
What to include in an RPM created from python packages
I'm looking to create a rpm for this tarball and couldn't figure out which files needed to be included in the package after the install. I am used to compiling some code and including the binary ...
1
vote
1answer
49 views
Virtual Python installation not allowing ez_setup?
I don't have root on my system, so I'm trying to create a virtual Python installation. I ran virtual-python.py, and it told me to run ez_setup.py. I found it online and ran it with the command ...
1
vote
3answers
165 views
I want to run commands like make, make install, python setup install without changing directories
I have written a script which will download software from the internet to the current user's home directory and then untar it. And then I have to make and make install it and in some software I have ...




