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

learn more… | top users | synonyms

3
votes
0answers
16 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 ...
1
vote
4answers
950 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 ...
3
votes
3answers
132 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
0answers
30 views

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

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 ...
1
vote
1answer
476 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 ...
1
vote
2answers
35 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 ...
2
votes
2answers
31 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
22 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
6k 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): ...
0
votes
0answers
17 views

Compare two folders and copy the difference to a third folder [migrated]

I am beginner with python and I have to do the same for my work. (link included) filecmp- code compare directories, take the different files. Me here! Everything okay with ls -1R /tmp/test/current/ ...
1
vote
0answers
33 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
204 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 ...
1
vote
1answer
54 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
70 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; ...
1
vote
1answer
197 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 ...
0
votes
3answers
41 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
4k 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
2answers
327 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 ...
1
vote
1answer
96 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
50 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
71 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 ...
1
vote
1answer
351 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 ...
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 ...
3
votes
2answers
911 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 ...
0
votes
1answer
57 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
71 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
53 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
110 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 ...
1
vote
3answers
70 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
5answers
67 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
433 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, ...
-2
votes
1answer
51 views

How to compile c, c++ and python code as “Released/Final” version? [closed]

I want to know if there are ways to compile C, C++ and Python code in order to not be able to reverse engineering it over Linux or not? I have heard there are some ways over Windows to do it, but I ...
25
votes
4answers
2k views

python vs bc in evaluating 6^6^6

I am evaluating the expression 6^6^6 using python and bc separately. The content of the python file is print 6**6**6. When I execute time python test.py, I get the output as real 0m0.067s ...
1
vote
0answers
51 views

How to import screenlets on Python

(I'm using Ubuntu 10.04 with Linux 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686) For some reason I had updated some Python files (I'm not able to tell which ones, but it was ...
0
votes
0answers
73 views

Installing cppman

I've tried to install cppman in Fedora 19 or Linux mint 15 and it installs successfully. But when I try to use it I get the error: Python IOError: [Errno 13] Permission denied I've installed it in ...
0
votes
1answer
57 views

How can I rejoin a process running

I am very new to using Linux. I have a 'machine' on Amazon and I was trying to learn how to use Python on this machine. I started running Python—had to step away for a few minutes and the connection ...
3
votes
1answer
89 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
127 views

Install wicd on Slackware 14.1

I am trying to install wicd-1.7.2.4 on Slackware 14.1. I couldn't find configure or makefile in wicd-1.7.2.4.tar.gz. Running python setup.py configure (following the INSTALL guide) causes: sh: ...
0
votes
0answers
24 views

Can't find module six.py when reverse engineering python project?

I'm trying to reverse engineer this project: MPL on my ubuntu system. I'm using epydoc to do this. If I run it and target the main __init__.py file, I get an error saying module six.py can't be found. ...
2
votes
1answer
30 views

Count and merge consecutive patterns

I'm searching for a short snippet to find, count and merge consecutive duplicates using standard tools or a common scripting language. Say our input is: 1 2 2 2 7 22 a b b c c c c c d dd 2 2 c c ...
2
votes
2answers
255 views

Debian 7.1: duplicity error when using gdocs backend

I've installed duplicity backup tool plus python-gdata library on my debian 7.1 amd64 system. When I want to use duplicity to store my documents on Google Drive, it shows this error after asking for ...
1
vote
1answer
550 views

FreeBSD Ports Broken — Python Issue? Portmaster -a

Upgraded FreeBSD from 8.2 >> 8.4 >> 10.0-RELEASE today. In the process, I believe I have mangled my ports tree quite badly and am having issues upgrading/reinstalling ports (as the upgrade asks me to ...
1
vote
1answer
48 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 - ...
1
vote
2answers
1k views

How to install the latest Python version on Debian separately or upgrade?

I'm still new to Linux, so I'm still trying to understand where executables and their libraries are and how to install packages, so I have Debian Wheezy 7.3 which has these Python versions: Python ...
0
votes
1answer
136 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: $ ...
2
votes
1answer
50 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
89 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
2answers
256 views

How to test UPSTART feature of ubuntu to see my script gets restarted automatically if it gets killed?

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. So I decided to use UPSTART ...
9
votes
7answers
2k views

How to restart the Python script automatically if it is killed or dies

I am running my Python script in the background in my Ubuntu machine (12.04) like this - nohup python testing.py > test.out & Now, it might be possible that at some stage my above Python ...
4
votes
2answers
317 views

fail2ban log parsing too slow on Raspberry Pi - options?

I'm running fail2ban on a Raspberry Pi at 950MHz which I cannot overclock further. The Pi is occasionally subject to SYN floods on particular ports. I've set up iptables to throttle the rate of SYNs ...