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

learn more… | top users | synonyms

2
votes
3answers
197 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
192 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
7k 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 ...
2
votes
1answer
93 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 ...
5
votes
2answers
2k 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
397 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
405 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
5answers
78 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
5k 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
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 ...
1
vote
0answers
107 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
85 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
90 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
1k 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
70 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 ...
3
votes
2answers
23k 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 ...
2
votes
1answer
208 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
2k 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
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
7k 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
494 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 ...
1
vote
0answers
74 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
123 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 ...
7
votes
3answers
2k views

Which window manager has Python bindings?

I've been coding bits here and there with Python and I'm most interested in Desktop Environments, for which I always have ideas I want to try out. I have tried to play around with python-xlib but ...
0
votes
0answers
287 views

mod_python won't “./configure” because it can't determine httpd version

I'm trying to install mod_python 3.3.1 on Apache 2.4.3 and whenever I try to run ./configure (with apxs etc) and instead of configuring correctly, it says that Apache 2.x is required and my current ...
0
votes
0answers
107 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 ...
1
vote
1answer
232 views

Installing python module pyexiv2 on CentOS?

I downloaded the latest pyexiv2 files: pyexiv2-0.3.2.tar.bz2 and I looked at the README file which said: To build and install the library, while in the top-level directory (e.g. '~/dev/pyexiv2', ...
1
vote
0answers
91 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
56 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
232 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
1answer
73 views

API for panel applets on eOS Pantheon?

Is there any API (esp python or bash) to append new applets on eOS Pantheon's panel? I can't find proper documentation.
0
votes
2answers
416 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
884 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 ...
1
vote
1answer
127 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 ...
2
votes
1answer
747 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 ...
4
votes
1answer
2k views

How to display the name of the current Virtualenv?

I'm using virtualenv, virtualenvwrapper, zsh, oh-my-zsh, terminator, on Crunchbang. I'm trying to display the name of the current virtualenv like so workon example (example)... I've tried many ...
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
151 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 ...
5
votes
3answers
327 views

How can you change the process name of Wing IDE from python to something more descriptive

In my process list under Ubuntu (using top/System Monitor) one of the largest memory hogs (200+Mb) was python. I searched a bit for one of my programs to be the cause until I realised this was my ...
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
2answers
967 views

Simple console text editor suited to python

I am looking for a light weight shell editor for Linux that a young child (eg 7-8 year old) can write python scripts in. The motivation is to find something that is helpful for a beginning programmer ...
0
votes
1answer
526 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
429 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
263 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 ...
0
votes
1answer
257 views

VIM(Mercurial) +python3.2 on debian wheezy: Could not load library function PySys_SetArgv

> ./configure --enable-python3interp=dynamic --enable-gui=gtk2 > --with-python3-config-dir=/usr/lib/python3.2/ make vim --version|grep pyth +cryptv +linebreak -python ...