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

learn more… | top users | synonyms

2
votes
3answers
75 views

Linux - preventing an application from failing due to lack of disk space

Due to an unpredicted scenario I am currently in need of finding a solution to the fact that an application (which I do not wish to kill) is slowly hogging the entire disk space. To give more context ...
2
votes
2answers
85 views

why cpulimit makes process STOPPED?

I'm running a python script which uses networkx package to run some algorithms on graphs. the script is import networkx as nx from networkx.algorithms.approximation import clique G = ...
2
votes
3answers
444 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 ...
2
votes
1answer
481 views

Replace python built with UCS4 with UCS2

I've got fedora fc15 installed with python 2.7.1-7.fc15. It is built with ucs4 and I've got some packages here at work that are built with ucs2. I now cannot build other packages that use these ucs2 ...
2
votes
1answer
2k views

parsing process ID/names from /proc, thread IDs

When I'm parsing process IDs from /proc, obviously each thread of a process gets its own ID. And I realize that all the threads in that same process can be gathered from /proc/${pid}/task/. But my ...
2
votes
3answers
735 views

Unmet dependencies

I am trying to compile vim and install with "--enable-pythoninterp" flag, which needs the python-dev package. INFO I obtained the vim source from ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2 Vim7.3 ...
2
votes
1answer
128 views

Piping periodic data between Python scripts

How to receive data from the environment e.g. bash I am trying to launch two Python scripts in bash and pipe stdout from one of them to stdin of the other. The first script outputs a single ...
2
votes
1answer
282 views

upgrade Python to 2.7.2

I have an embedded system running on Python 2.6.5 and i want it to upgrade to 2.7.2 (I have a running system with different kernel that runs 2.7.2). I have copied the binary but then it told me: ...
2
votes
1answer
392 views

Unable to install SciPy

I need to use the module skimage, which calls the module SciPy (I need to find contours) import numpy from sys import argv from PIL import Image from skimage import measure # Inicialization ...
2
votes
4answers
435 views

Keep running program requiring X server after logging off of ssh session

I have a python script that periodically generates a png image, and puts it on a server that I can access through a browser. The image displays the progress of a job I am running on the server. I'm ...
2
votes
2answers
3k views

Run a sudo (or startup) python script from cron on a Raspberry Pi?

I'm helping out with an art project (http://stargateeggbeater.com/ for those interested) built on Raspberry Pi. The RPi controls an addressable LED strip through the GPIO, using the spidev device per ...
2
votes
1answer
746 views

Pip install - CPU you selected does not support x86-64 instruction set

I'm trying to use pip install mysql-python inside a virtualenv container and am getting the error building '_mysql' extension gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall ...
2
votes
1answer
127 views

Change the default shell to Python

If I changed my default shell from BASH to Python3 or IPython, would my Linux system have issues or produce errors?
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 ...
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".
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 ...
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
946 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 ...
2
votes
1answer
483 views

Subprocess.call() and gunzip error

I'm trying to use Python's package subprocess to gunzip and gzip files. I'm using the following command: subprocess.call(['gunzip', a_path+myfile_gz], shell=True) Then I get the error message: ...
2
votes
2answers
1k views

What does this python2 error mean, and what should I do about it?

Whenever I attempt to use an application relating to python2(gnome-tweak-tool, bzr, etc.) it fails to start and, when run from command-line, I get this error: [username@host ~]$ gnome-tweak-tool ...
2
votes
1answer
204 views

Key-binding to open a terminal running python in ratpoison

In my .ratpoisonrc file I'm failing to write a key-binding to open a terminal running python. I'm running a minimal Debian setup on which I basically just run emacs. Sometimes I want to just get a ...
2
votes
2answers
2k views

How to execute this particular shell command from Python?

OK, so, I have this non-functional shell script, which I am rewriting piece by piece in python, except I am getting an "unexpected "|" error" from the shell (see below): #/bin/sh LINES=`cat $@ | wc ...
2
votes
1answer
14 views

Python failing to import winregistry

I'm trying to use secretsdump.py, which relies on winregistry.py. The error I'm getting is: Traceback (most recent call last): File "secretsdump.py", line 41, in <module> from impacket ...
2
votes
1answer
80 views

How to install Node.js in CentOS 5.10 with Python 2.4?

I want to use Grunt on websites we have hosted on our WHM dedicated server. It is running CENTOS 5.10 x86_64 standard with WHM 11.42.1 (build 21). It is critical that things do not break, as we have ...
2
votes
1answer
67 views

Application lags if started from init.d?

I have a program (pre-compiled binary) that, when started manually on linux, runs fine. It has a CLI that I use to enter commands. This program is a software router, I can connect to it's CLI to ...
2
votes
1answer
149 views

How can I disable the new history feature in Python 3.4?

Since upgrading to Python 3.4, all interactive commands are logged to ~/.python_history. I don't want Python to create or write to this file. Creating a symlink to /dev/null does not work, Python ...
2
votes
1answer
799 views

How to check the status of bash shell script while executing from Python script?

I have a simple Python script which will execute a shell script using subprocess module in Python. Below is my Python shell script which is calling testing.sh shell script and it works fine. import ...
2
votes
1answer
241 views

Installing pyside on Fedora 19

I'm trying to install pyside from source on Fedora 19. Running sudo python setup.py bdist_egg --version=1.2.0 --qmake=/usr/lib64 gives: HEAD is now at 92062bc... Version bump to 0.2.14 Checking out ...
2
votes
1answer
176 views

apt-get can not detect correct python version when using update-alternatives for python

I have installed different python versions on my Linux Mint DE. I used the update-alternatives --set statement to easily switch between the different versions. Unfortunately sometimes apt-get install ...
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 ...
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 ...
2
votes
1answer
415 views

Installing trac - “Trac requires Python 2.5 or later”

I am having a little trouble getting trac 1.0 installed via easy_install: [box]# easy_install Trac==1.0 Downloading ...
2
votes
1answer
799 views

New files and folders created, automatically inherit same permissions as parent folder

Does it exist? I create a folder with, let's say, all permissions set, and some services (i.e. Apache web server) create subfolders and put files there (uploaded media files from website users). Such ...
2
votes
1answer
187 views

Will I break debian etch if I install python-support 0.7.1 to it?

I try to install s3cmd into my debian etch, but the following error message comes up: root@NAS-01G:~/src$ sudo apt-get install s3cmd Reading package lists... Done Building dependency tree... Done ...
2
votes
2answers
3k views

FreeBSD: How to install Django with mod_wsgi?

Using FreeBSD 8.2-RELEASE. I want to mess around with Django and I want a working setup on my freebsd system. My understanding is I need to install python, apache, mod_wsgi, and django. The ...
2
votes
1answer
203 views

Virtualenv creation seems to do nothing

I have a problem setting up a Virtualenv on my web host server (to install python modules later on) So far I tried this (over SSH): wget ...
2
votes
1answer
580 views

pysvn fails to make due to -lneon not found?

I am trying to install pysvn on my CentOS server and it says that -lneon is gone. After searching their mailing lists for a bit I found what neon means but it doesn't say how can I get it? Here's my ...
2
votes
1answer
384 views

Python script run while screen is locked

I have a python script which seems to be failing to continue running its while True: ... sleep() loop my code is at http://github.com/xdaimon/xdaimonConky What happens is I autostart python on ...
2
votes
0answers
101 views

listen a power-button event in Python (no ACPI)

I am using a Debian machine which does not include the acpid package. Is there a way that I can reboot the machine using Python language when the power-button is pressed, without installing that (or ...
2
votes
0answers
336 views

FreeBSD: How to start a python script as daemon?

I'm facing an issue with a python file that I'd like to start as a service. I named my service ocrserver and the script I want to start is in /home/administrator/ocr/ocrserver/init.py with some ...
2
votes
0answers
133 views

mozilla sync server and mysql auth

Recently I updated my debian squeeze to wheezy. Unfortunately my firefox sync server (weave) stopped working. I saved the config files and downloaded the new version via hg. I already fixed some ...
2
votes
1answer
436 views

ffmpeg webcam to device driver , output 8 bit grayscale

With the following command i'm trying to capture 10fps and send them the device driver. Now i want 8 bit gray raw frames (640x480= 307200 bytes per frame) to be send to the device driver. I can't ...
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 ...
2
votes
0answers
1k views

MySQL socket and PHP (and other languages)

Background info I'm currently running CentOS (or Red Hat?). uname -a gives (I edited out my domain name) Linux XXXXXXXXX.com 2.6.32-71.29.1.el6.x86_64 #1 SMP Mon Jun 27 19:49:27 BST 2011 x86_64 ...
1
vote
5answers
73 views

Replicate a column in a one-line CSV file

I have a file that consists of a single line: a,x,b,c,d,e I want to convert this into a,x,b,x,c,x,d,x,e,x Which is the easiest way to achieve this? A solution based on Python will be most ...
1
vote
4answers
241 views

Pattern Matching and Delete the whole line

I want to delete all the Lines of File 1, if Column1 of File1 matches exactly with Column 1 File2. File 1: r001:21:10 21 AAAAAATTTGC * = XM:21 r002:21:10 21 YAAAATTTGC * ...
1
vote
4answers
2k views

parse json using python

I have a JSON file members.json as below. { "took": 670, "timed_out": false, "_shards": { "total": 8, "successful": 8, "failed": 0 }, "hits": { "total": 74, ...
1
vote
2answers
101 views

Narrow characters

It would be awesome to modify spark to print narrow characters in for example Gnome Terminal. Is this at all possible with Bash / Python?
1
vote
3answers
208 views

Distributions that only ships Python 3.X

Is it possible currently? I tried to remove python in Fedora 19 but yum depends on it.
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 ...