Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.

learn more… | top users | synonyms

1
vote
1answer
2k views

Can't run 32 bit python on 64 bit Ubuntu: error while loading shared libraries: libutil.so.1

I'm trying to run a 32 bit version of python on 64 bit Ubuntu 12.04. There are alternatives to running this specific binary, but I'm more interested in understanding what's causing the error than ...
1
vote
2answers
4k views

On Red Hat Enterprise Linux 6.2 how can I use Python 2.7 as default not Python 2.6? I did but still showing 2.6?

RHEL 6.2 I have python 2.6 but I need default python 2.7 using yum packaging (so that nothing goes messed up, cause its a heavy duty working system, all I need the python 2.7 on it, without messing ...
1
vote
1answer
303 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 ...
1
vote
2answers
353 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)
4
votes
3answers
1k 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
391 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
131 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
503 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
390 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
67 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 ...
6
votes
4answers
1k 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 ...
5
votes
3answers
256 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 ...
2
votes
1answer
402 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
114 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 ...
1
vote
1answer
458 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
71 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
108 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
2k 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
252 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
41 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".
3
votes
3answers
1k 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
64 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
85 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
251 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
442 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
460 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
193 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
330 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
75 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 ...
1
vote
1answer
155 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
3answers
325 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?
8
votes
5answers
1k 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
178 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. ...
2
votes
2answers
176 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 ...
3
votes
1answer
2k 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
281 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
230 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
119 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 ...
2
votes
4answers
944 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
112 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
52 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
160 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
235 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
862 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
58 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
103 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
255 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 ...
1
vote
3answers
1k views

How to run a Python script in Makefile

I want to write a Makefile to find specific files and run a Python script on each file. The Python script accepts sys.stdin input. find $(W)/$(OVE) -name "*.xml" -print | \ while read x ; do \ cat ...
1
vote
1answer
130 views

When I am in VirtualEnv and do apt-get install, is there any difference?

If I have a virtualenv activated when I do something like sudo apt-get install python2.7-dev should I expect different results than if I did it outside the virtual env? Limited theory says no, ...
1
vote
2answers
628 views

Running google cloudprint on boot

I use this Python script on my Debian based Guru Plug to make it work as a print server for Google Cloudprint. With this I can print from my Android devices using apps like PrinterShare or Cloud ...