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

learn more… | top users | synonyms

3
votes
2answers
2k views

Installing python modules for python2.6

On my CentOS 5.8 system (el5 , 64bit), I had python2.4 after OS install and I installed python2.6 now. Now I want to install python modules using yum. But whenever I install a new python module it ...
1
vote
1answer
451 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 ...
3
votes
2answers
37 views

Tilling window manager written in Python

Is there any tiling manager like XMonad but written with Python? I think Haskell was too hard for me. But I know python a little.
2
votes
2answers
51 views

How to change my script to replace and add new variable in a configuration?

Well this is my script. It is to configure my systems sysctl.conf. infile = open('sysctl.conf') outfile = open('sysctl.conf.new', 'w') replacements = {'Net.ipv4.icmp_echo_ignore_all' :'1', ...
-1
votes
1answer
25 views

add groups from external file

I want to write a script which add groups to the system, specified in groups.txt file. content of groups.txt : group01 : computer group02 : electronics group03 : IT . ...
1
vote
1answer
637 views

setcap error on Debian Squeeze: “unable to set CAP_SETFCAP effective capability: Operation not permitted”

My python script needs at least the CAP_NET_RAW capability, because it's using a pcap library, but I don't want to use sudo (and in fact sudo causes my script to not work properly, with the script's ...
3
votes
1answer
45 views

Grepping a variable

I've written a simple init script to start and stop a Python script as a service. I have to be explicit about the version of Python I'm running, because this is on a CentOS 5 box with Python 2.4 & ...
1
vote
1answer
14 views

'altinstall' python-devel; can't install psycopg2 on centos

I installed python2.7 on my centos 2.6.32-431.17.1.el6.x86_64 following these directions: http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/ #after the yum stuff... # Python ...
0
votes
2answers
26 views

Why can't my python script change umask?

This is my script #!/usr/bin/python import os print "hello world from python" os.system("echo 'hello world from bash'") os.system("umask 055") os.system("ls -alh > test") If I run this code ...
0
votes
3answers
29 views

Python compile error on openSUSE: no module named wx

I'm new to Linux. After installing openSUSE I'm trying to make my VPN software running. I've followed the site's direction: Unpack the general package [Other / Source code], install OpenVPN and ...
2
votes
1answer
373 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 ...
5
votes
2answers
225 views

how to read and modify fstab in python?

I want to automatically configure my fstab in python by running a script. I thought of using ConfigParser in python, but I am unable to use it properly.
9
votes
1answer
10k views

How can I start the python SimpleHTTPServer on port 80?

I am using this command on Ubuntu but it is starting on port 8080 and I don't have another server running so I'd like it to start on port 80. I saw ways that you could set up a bash script to do ...
1
vote
2answers
432 views

installing eric5 in CentOS 6.4

I am trying to install Eric Python IDE 5 in my CentOS 6.4. The problem here is even I have installed PyQT4 its again saying that module is missing. what I am supposed to do ? here is the terminal log ...
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 ...
1
vote
1answer
67 views

Trouble installing lxml with custom install location for libxml2/libxslt

I am attempting to install a python module called lxml to my account on a supercomputer running RHEL. I do NOT have root access or super user status. lxml requires the dev/devel versions of libxml2 ...
2
votes
1answer
107 views

Convert xml subtitle file to srt format

I have a xml subtitle that looks like this: <?xml version="1.0" encoding="utf-8" ?><transcript> <Item from="1.16" duration="4.68"><![CDATA[(Dong-hyuk is coming to see you now.) ...
1
vote
1answer
383 views

Running ipython notebook on Debian

I'm trying to get ipython notebook to run on my Debian machine without much success. I've installed ipython and ipython-notebook via apt-get, but when I try to start it up I get the following: $ ...
1
vote
2answers
82 views

Do all Linux processes write EOF to stdout when they are terminating/have finished terminating?

I'm having trouble with sending shutdown -h 0 to a lxc Debian container (i.e. executing this command in the lxc) with with the python pexpect module (in a python script). In this module the user can ...
3
votes
1answer
595 views

py3compile error - Unable to get the locale encoding

After reinstalled the python3.2, I got the error as below when call py3compile: Fatal Python error: Py_Initialize: Unable to get the locale encoding LookupError: no codec search functions registered: ...
2
votes
3answers
85 views

Unable to access CentOS setup Network Configuration after attempting Python update

I attempted to update Python on my CentOS 5.6 VM and have encountered some issues afterward. Initially, yum wouldn't work, but I have resolved that. However, now I am unable to access the Network ...
2
votes
1answer
70 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 ...
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
vote
1answer
26 views

Identify python script is waiting for a manual input

I'm writing a shell script which executes a Python script. The Python script halts for a manual enter to be provided. However, I don't wan't to have to press enter each time to the script. Instead, I ...
0
votes
2answers
193 views

Adding ALSA module in Python in Linux

I have recently started working in linux, I wanted to to add ALSA module in my Python. I have used this, sudo apt-get install libasound2-dev After that I've installed pyalsa package, pyalsa ...
1
vote
1answer
119 views

Different version of Python cannot find modules

In my Suse system I have these 2 versions of Python: # which python2.6 # /usr/bin/python2.6 # which python2.4 # /usr/local/bin/python2.4 2.6 is the system one, and 2.4 was compiled by me. If I ...
1
vote
2answers
75 views

How to change the default version of Python in Debian 7.5?

I'm using Debian 7.5, and I've installed Python 3.3 and 3.2. How do I make 3.3 the default for when someone types python in the command line?
2
votes
3answers
646 views

How to install StackApplet on Debian?

I would love to install StackApplet on Debian 6.0.2! I downloaded 'stackapplet_1.4.0_all.deb' and ran following command: root@debian:/home/dagrevis/Downloads# dpkg -i stackapplet_1.4.0_all.deb ...
0
votes
1answer
65 views

How to install QGIS from source into user space?

I want to install QGIS from source on Ubuntu 13.10. (saucy). into ~/bin. There is Python 2.7.5+ installed. Therefore, I cloned the repository to my machine and checked out the master branch. First I ...
4
votes
3answers
3k views

Install PIL/Pillow via pip in Debian testing (Jessie)

On Debian testing (Jessie), when I try to install PIL or Pillow (python imaging libs) in a virtualenv via pip I get the following error: running egg_info writing Pillow.egg-info/PKG-INFO writing ...
2
votes
2answers
110 views

How does a parallelized Python program look with top command?

I work on a shared cluster. I've seen people run parallelized c code on this cluster which, when I use top to see what processes are running, are shown to be using (for example) 400% of the CPU, ...
2
votes
4answers
931 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
2answers
41 views

How do I remove the new environment commands that were created by the virtualenvwrapper script?

I've installed and run virtuarenvwrapper.sh to try to configure an alternate version of python on my system. This script has placed somewhere a series of commands that are now executed whenever I ...
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 ...
2
votes
1answer
238 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
3answers
72 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 ...
1
vote
4answers
678 views

chmod - change permissions on a file

I have a Python virtualenv, and the Python executable is located in the /bin directory. In this virtualenv I'll have to execute some unsafe code, that can damage my system. I tried to chmod a-r on the ...
1
vote
2answers
105 views

How to restart python script after one second of going down using UPSTART?

I am running my Python script using upstart feature of Ubuntu so that if for whatever reason my Python script dies or gets killed, it can be restarted automatically and everything is working fine - ...
0
votes
1answer
57 views

Python3 error “no module named bluetooth” on Linux Mint

I am trying to connect my Lenovo S10E to a Nintendo Wiimote via bluetooth. I am using a simple Python script, reproduced below. I am calling it from the Linux Mint (version 16, "Petra") command line ...
3
votes
2answers
156 views

Rescue value from second last line

After I run a script, I've got the following lines: PyMOL(TM) Molecular Graphics System, Version 1.4.1. Copyright (c) Schrodinger, LLC. All Rights Reserved. Created by Warren L. DeLano, ...
0
votes
2answers
56 views

shell or python script to transpose rows to columns [duplicate]

I have a big file with numbers like: 1 2 3 4 5 6 7 8 9 9 9 9 I want to tranpose it into 1 5 9 2 6 9 3 7 9 4 8 9 I have search on google for solutions, but those solutions simply don't ...
1
vote
1answer
32 views

Uninstall a python software properly

I installed a little python software (pycarddav) before to notice there is a packaged version for Debian sid... Now, I would like to uninstall properly this software and then, install the packaged ...
0
votes
1answer
56 views

Python file issue from root path

I have a script that is well-tested and known to be working. I am running into an issue with it where when I try to run it from /root/backup/script.py or ~/backup/script.py I get a file not found ...
3
votes
5answers
162 views

Listing directories based on size from largest to smallest on single line

I can use the following command to get a list of directories and their sizes and sort them from largest to smallest (in the example I renamed the directories to numbers to make this easier to ...
0
votes
0answers
54 views

Installing iPython3 Fedora 20

It was very easy to install ipython and upgrade it to the newest version (2.0) using pip. However, I want to set up ipython3, which uses Python 3, and found it more difficult. I finally installed it ...
0
votes
1answer
34 views

install python module for particular python instance

I have 2 python instance on a CentOS machine, i.e. /usr/bin/python2.4 and /usr/bin/python2.7. Modules for 2.4 are in /usr/lib/python2.4, and modules for 2.7 are in /usr/local/python27. When I do ...
1
vote
4answers
225 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 * ...
3
votes
1answer
91 views

fail2ban permission denied on script

I've just upgraded from RHEL 5 to 6.5 and setup fail2ban anew. I can't seem to get my custom action to work now, supposedly because of a permission issue. I wan't to know what am I doing wrong, and ...
0
votes
1answer
79 views

python xml parsing

I have to delete particular tags from an xml file. Sample xml below. <data> <tag:action/> </data> I want to delete all contents between data and /data. ...
3
votes
1answer
142 views

How do I make Kate indent with spaces on Python files but use tabs for text files and other files?

My goal is to set Kate up to work properly on Python files but to use different settings (tabs not spaces) on other documents. I'm sure others are doing this, but I can't figure out a convenient ...