Tagged Questions

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

learn more… | top users | synonyms

2
votes
1answer
82 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 ...
1
vote
2answers
1k 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 ...
3
votes
2answers
208 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
347 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
2k 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
71 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
355 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
593 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
77 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
80 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 ...
26
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
4k 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
104 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
86 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
911 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: ...
3
votes
1answer
67 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 ...
2
votes
4answers
189 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 - ...
3
votes
2answers
19k 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
724 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
202 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
1k 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
524 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
1k 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
6k 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
70 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
121 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
32 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
1k 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
1answer
86 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
100 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 ...
7
votes
4answers
6k 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
82 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
55 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
202 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
369 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
801 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
658 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
120 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
145 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
70 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
502 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
408 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
236 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
473 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
2k 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
400 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
146 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
60 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
271 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 ...