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

learn more… | top users | synonyms

2
votes
1answer
148 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 ...
0
votes
1answer
149 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
944 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
66 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
193 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
4answers
236 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
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 ...
-2
votes
1answer
66 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
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
0answers
85 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
1answer
75 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 ...
1
vote
1answer
461 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: ...
2
votes
1answer
46 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 ...
1
vote
1answer
1k 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
2answers
108 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
9k 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 ...
1
vote
1answer
400 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
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
270 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
383 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
2answers
728 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 ...
10
votes
7answers
4k 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 ...
1
vote
0answers
55 views

Cygwin DenyHosts daemon-control file: no such file or directory error

I have been trying to figure out this error and searched everywhere with no luck. I have installed DenyHosts on Cygwin and also the DenyHosts daemon but when I try to start the daemon by typing: ...
2
votes
0answers
100 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 ...
0
votes
0answers
28 views

python3.3 build from source

When running make test while doing a build from source for python3.3 I had 25 tests skipped and 14 skips unexpected on linux. OS Debian 7.0 64 bit server. How can I figure out what packages are ...
2
votes
1answer
791 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 ...
0
votes
0answers
60 views

PiGlow not working

After following the steps specified in Boeeerb's PiGlow github repo, when I try to run the test.py file it gives me the following message: Traceback (most recent call last) : File "test.py" , line ...
0
votes
0answers
73 views

Install qtile 1.6 from the source

I try to install qtile from the source, you can see also this link: Install libxcb from source When I try to launch qtile I have this error, I do not understand why: Traceback (most recent call ...
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 ...
1
vote
0answers
68 views

mongodb “hijacking” port

I'm having some trouble with Python HTTP Server and MongoDB. In this case HTTP server represents a REST service providing data from MongoDB. MongoDB is running on default port (27017) at all times. ...
0
votes
0answers
48 views

What Ubiquity files should I change or interface with to make a change to Ubiquity?

There's a difference between the GTK and Qt/KDE versions of the Ubiquity installer. The GTK version doesn't take you to a manual disk partitioner if you choose the dual boot radio button. The Qt ...
1
vote
1answer
118 views

Missing Python.h in Arch

I use Arch Linux. I want to compile a C++ file that includes <Python.h>. But I can't do it. In Debian based systems this problem is resolved with sudo apt-get install python-dev. How I can ...
0
votes
2answers
224 views

Compiling python .py to .pyc doesn't happen

I have read that python will compile the source file .py by itself to produce .pyc, but this doesn't happen in my case. I have the source file inside /opt/osqa folder where I always have to use sudo ...
1
vote
3answers
546 views

How to install easy_install using non-default Python Interpreter on CentOS?

I have downloaded, compiled and installed Python 2.7 on CentOS. I would like to download and install easy_install (and pip) for it but I am a little bit confused as to how to do that. How can I ...
2
votes
1answer
390 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 ...
1
vote
1answer
88 views

trac svn python bindings messed up rebuild python

My trac and svn used to work it still does if i click on the links many times. How ever it complaines of he followign and i am not sure what to do i have followed ...
0
votes
1answer
131 views

playonlinux crashing on Fedora 19

I installed playonlinux using the default repository and when I run the command 'playonlinux' its getting crash and prints this output Traceback (most recent call last): File "mainwindow.py", line ...
1
vote
1answer
64 views

Protected Execution Environment

I've been recently investigating for the best way to implement a Protected/Secured Execution Environment that would allow me to "upload" some code into that environment and block any kind of output ...
0
votes
1answer
421 views

Trying to install numpy, nltk to python 2.4 on CentOs 5.10 with multiple versions of python installed - python 2.4 and python 3.3

I've inherited a project on a hosted server and I'm trying to install and import numpy and nltk into the project. The OS is centOs 5.10 and the web app uses web.py. There are two version of python ...
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 ...
1
vote
1answer
130 views

How can i fix the following gmp library dependency error while trying to install Charm?

I am trying to install Charm crypto python framework in ubuntu 11.04 with python 2.7. Requirements say that i should have gmp installed 5.*. I have successfully installed gmp lib and i have run all ...
4
votes
2answers
397 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 ...
3
votes
1answer
1k views

Python not recognizing LD_LIBRARY_PATH?

I am trying to install Python2.7 on cr-48 chromebook in developer mode, and face a weird issue that I am having hard time searching for a solution on google. First some background.. the root partition ...
1
vote
1answer
259 views

No module Found error in Linux but Works fine in Windows

I am trying to run a Program that I coded in Python in Windows environment When I am trying to copy the program and running it in Linux(Debian), It won't work, It is giving the following error, ...
0
votes
1answer
125 views

Python error after installing libboost-all-dev on debian

A friend of mine wanted the libboost libraries installed on our shared computer so after installing libboost-all-dev 1.49.0.1 (a Debian wheezy machine), I get this error when using the "pydoc modules" ...
1
vote
3answers
55 views

How can I make a switch accessible via the internet, that allows users to turn on or off a python script?

I have a python script running on a home laptop that runs Ubuntu 13.10. I want to give 2 or 3 people the ability to start or kill that script, but no other privileges. I don't want to give them access ...
0
votes
2answers
214 views

Making md5sum understand file names with spaces

I need to use md5sum in Python by using pipe to calculate checksum for a bunch of .mp3 files... is there a command which ignore whitespaces in filenames on the command line of md5sum program? For ...
3
votes
1answer
274 views

python3 traceback error

Whenever I mistype any command in terminal instead of getting Error:Command not found I get this python message error Traceback (most recent call last): File "/usr/lib/python3.3/site.py", line ...
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 ...