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

learn more… | top users | synonyms

1
vote
1answer
130 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
119 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
659 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 ...
2
votes
2answers
122 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
1k 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
45 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
253 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
76 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
703 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
127 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
96 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
161 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
78 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
38 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
73 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
206 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
74 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
45 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
318 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
129 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
113 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
164 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 ...
1
vote
1answer
108 views

Modoboa 1.1.1 Deployment Errors

I try to install modoboa follow this steps: http://modoboa.readthedocs.org/en/latest/getting_started/install.html I installed modoboa with pip install modoboa Traceback (most recent call last): ...
1
vote
2answers
177 views

pipe function arguments to command line arguments in python

I have a python code (cmd.py) which accepts files as command line arguments and process using parse_args. I want to pass files from another code (files.py) to cmd.py, just like passing function ...
0
votes
1answer
28 views

Python: Move lines backward in a textfile

Imagine a text file which contains random text and two unique markers 01 text text text 02 text text text 03 __DELETE_THIS_FIRST__ 04 text text text 05 text text text 06 text text text 07 text text ...
5
votes
3answers
99 views

How to grab the oldest unread message from `mail` in a script?

In a script I am trying to finish writing now, I need to get the oldest unread message from the current user's mailbox (specifically, I need the subject line for this project). After extracting the ...
4
votes
4answers
388 views

How do I get 'realpath' to find my symbolic link?

I am on MacOSX using bash as my shell. I have symbolic link, created like this: ln -s /usr/bin/python python2 I have a package that uses python2 and I want to create a symbol link in my current ...
1
vote
1answer
102 views

Why does PyCrypto require a C compiler?

Is there a python crypto library that does not rely on anything besides python? Or pre-complied bundles of PyCrypto for Linux?
0
votes
1answer
144 views

makehuman gives “ImportError: No module named numpy”

I installed 1.0.0 on slackware 14.1 makehuman 64bit slackbuilds through the site, but the makehuman does not open, the program appears in the KDE menu but does not open. I do not know why it happens, ...
3
votes
1answer
323 views

apt python error prevents me from resolving dependency problems for apt-get install

On Debian 6 servers dependency issues are preventing me from installing nis (or any package). When I try to resolve that issue I get a python error. How do I get past this issue and re-gain the ...
0
votes
0answers
72 views

Installation location of python modules?

How does one get python modules working on a local machine? I followed the doc here: https://docs.python.org/2/install/ to no avail. I tried putting a known working module in the following locations ...
1
vote
4answers
1k views

pysqlite install error on FreeBSD in virtualenv

I am trying to install pysqlite using pip under a virtualenv in FreeBSD 7.3, with Python version 2.6.2. I didn't have any issues for installing other packages like Django, PIL etc. All of them I ...
1
vote
0answers
69 views

Unexpected behavior from an “os.system”call in Python [closed]

I want to save the file type of the file sample in a text file called type.txt. I wrote the following for that in Python: os.system('file sample > type.txt') When I run this code, type.txt shows ...
2
votes
2answers
104 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 = ...
0
votes
0answers
32 views

Need a different header path for compiling

I'm trying to update numpy, a python package, on my fresh install of debian. I have installed from source the latest version of python in /usr/local When trying to update numpy via pip, I get an ...
7
votes
4answers
8k views

Why is this python error message generated whenever I type a nonsense command?

Whenever I type any "nonsense" command, this python error message is generated. Normal commands work fine. Any idea how to debug this? $ somenonexistingcommand Traceback (most recent call last): ...
1
vote
0answers
72 views

Why is the Debian package I've created for a single Python script empty?

I have a quite simple Python project that might be very useful for some people. So I thought about packaging it. The project is called maptool and is a tool that allows people who have Panasonic ...
1
vote
1answer
317 views

E: python-setuptools upgrade fails, apt-get broken

I wanted to install gnome-maps with apt-get, and then I got this error: Preparing to unpack .../python-setuptools_3.4.1-1_all.deb ... Unpacking python-setuptools (3.4.1-1) over (3.3-1) ... dpkg: ...
2
votes
3answers
140 views

What should someone know about using Python scripts in the shell?

I'm wondering what should someone generally know about Python(the interpreter) when using it in the shell in Linux? This is what I have on Gentoo: # ls -al /usr/bin/python*; file /usr/bin/python; ...
0
votes
3answers
104 views

Most accurate disk usage report? [duplicate]

Since disk space is allocated in blocks, is it a more accurate representation of the actual space consumed by a directory to report it in blocks vs bytes? If a file of size 1,025 bytes resides on a ...
4
votes
3answers
6k views

Running python script from terminal without .py extension

I want to call a python script script.py from the terminal by simply typing script. Is this possible? If so, how? I know I can avoid typing python script.py by adding #!/usr/bin/env python to the top ...
1
vote
1answer
602 views

Multicast UDP not working

Multicast UDP on raspberry pi I haven't narrowed things down enough to know if my issue is because of debian, raspbian specifically, or if I am just missing a something completely. I have a python ...
2
votes
1answer
71 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
173 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 ...
5
votes
2answers
1k views

On Debian, how do I add a Python package in dist-packages to a virtualenv?

Given some python package in /usr/share/pyshared/ or /usr/lib/pythonX.Y/dist-packages/ (take python-numpy or python-scipy for example), how do I add that package to a virtualenv? When adding the ...
0
votes
1answer
199 views

Bare-bones linux? [closed]

I am working on a homemade OS and I was originally going to write it myself in Assembly and Python, but I decided that doing this would just be easier, faster, and more Linux-y. I have the Python part ...
1
vote
1answer
1k views

How to exit out of the shell script successfully so that python subprocess think it is successfull exit? [closed]

Below is my shell script which simply execute a url like this http://example.com:8080/beat and parse the response and verify certain conditions on it. If that condition is met, then exit successfully ...
1
vote
0answers
68 views

Better approach to generating and adding contents to files

I have an input file like below. 1 First one 2 First two 3 First three 3 Second three I am generating 2 output files like below. #FILE1 1 First one 2 First two 3 First three #FILE2 1 ...
3
votes
2answers
247 views

case sensitive substitution; same target ids

I am struggled myself to make a case sensitive replacement in a text file. Please find below a segment of my sed file that I am running as sed -f file.sed < input.txt > output.txt ...