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

learn more… | top users | synonyms

0
votes
2answers
32 views

Writing a program for editing .txt data - Python or Unix?

I only have little experience in programming, and I'm currently working on improving my skills. Basically, I need to write a program, that can do some specific processes to some data in a .txt file. ...
1
vote
1answer
18 views

Get 'python-keyring' to stop prompting for 'encrypted keyring' password

Situation: I followed these instructions (http://mercurial.selenic.com/wiki/KeyringExtension) on setting up the mercurial keyring-extension for mercurial. On a Ubuntu 12.04.4 (precise) machine it ...
0
votes
3answers
53 views

How do I print a certain line of python code using the Linux terminal?

If I am writing some python and I only want the terminal to show a certain line, what command do I use? For example my program is: print("line one") print("line two") print("line three") And I only ...
2
votes
3answers
60 views

Replace multiline string in files

I have a number of files I want to update by replacing one multi-line string with another multi-line string. Something along the lines of: * Some text, * something else * another thing And I want ...
0
votes
0answers
22 views

errors while installing python-pip on ubuntu

When running sudo apt-get install python-pip I got the following error messages, what causes the problem and how to fix it? Thank you very much for any help. Err ...
0
votes
0answers
32 views

Homebrew?? error: option --no-user-cfg not recognized

Using homebrew, in which I am have no skill, I was updating cmake (as part of install of avidemux...) on snow leopard $brew -v upgrade cmake Everything works fine through Verifying ...
0
votes
0answers
32 views

Unable to use python speech_recognition lib Microphone class due to ALSA

I am attempting to write a speech recognition program for the raspberry pi, however I am facing some issues using python's speech_recognition library. From the error messages (posted below) I think ...
2
votes
0answers
27 views

arecord until sound level drops low enough

I am trying to implement constant voice recognition on my Pi at the moment, I am achieving this by having two threads running, one constantly recording (with arecord in a bash script) for X amount of ...
1
vote
2answers
45 views

Installing older versions of python packages with apt-get (specifically wxpython)

I've been beating my head against the wall trying to troubleshoot a graphical program with a WX backend. We've found that wxPython 2.8.10 work fine, and seemingly any newer releases doesn't. Despite ...
3
votes
0answers
31 views

Finding certain X window with Python's Xlib

I am trying to find an unmapped window on my X server in order to map it back and send it some EWMH hint. Because the window is unmapped I cannot use EWMH to ask the window manager directly. So I am ...
5
votes
2answers
183 views

If any spawned child processes fail, kill all and exit

In my script I split up a data set into input_aa, input_ab, etc. Then, I run each through the same Python script, as such: # Execute program on each split file for part in input_*; do python3 ...
0
votes
0answers
2 views

What potential trouble may arise by copying module directly from one python sys path to another?

Our server is CentOS and sys python is in version 2.6, meanwhile there is also a python2.7 under /usr/local/bin I did yum install MySQL-python, but in python2.7 I can't import this module. So I ...
0
votes
2answers
49 views

Runs perfectly through the command line, will not work through systemd ExecStart

I've installed Butterfly http terminal server, written in python, on my Arch machine. I'm new to systemd, but I'm having an issue with one of the command line parameters. /usr/bin/butterfly.server.py ...
0
votes
1answer
52 views

Why does apt-get in Ubuntu still want to install Python 2.7?

New Linux VPS, installing Python and a few other tools I like to use. Did apt-get update and apt-get upgrade, and I noticed when I did apt-get install python it defaulted to version 2.7. (I can, ...
-1
votes
0answers
25 views

How to run a script when install a rpm package and answer the installation questions

I will like to know how to install the RPM and answer the installation question automatically if is possible. any ideas.
0
votes
1answer
398 views

How to setup and use yowsup-cli to to get Whatsapp authentication code?

I've tried following the same way mentioned everywhere, but something is wrong. sudo apt-get install python python-dateutil python-argparse sudo wget ...
0
votes
1answer
24 views

/usr/lib/python2.4/site-packages/cElementTree.so: wrong ELF class: ELFCLASS32

yum update There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: /usr/lib/python2.4/site-packages/cElementTree.so: wrong ELF class: ...
1
vote
2answers
142 views

What should I do about Python 2.7.9 not looking for SSL certificates in the right place on FreeBSD?

I have a FreeBSD 10.0 system, and a couple of days ago, I upgraded my python27 port from Python 2.7.8 to Python 2.7.9, which enabled SSL verification by default. Unsurprisingly, it broke my existing ...
1
vote
2answers
58 views

How can I replace bash using Python?

According to the accepted answer for this SO question: , Python can make a great bash replacement. My question then, is this: how do I go about seamlessly make the switch? I think the main thing to ...
3
votes
3answers
117 views

Unable to run python script - Permission Denied

Trying to run a NZBGet (Python) Script, I've tried to run manually with: /mnt/local/ext001/MEDIA/NZBGet/scripts/videosort/VideoSort.py but this results in: bash: ...
1
vote
1answer
74 views

How to install the pylzma python library on Linux?

The pylzma library is a requirement for another tool that I would like to use. I am new to python and programming and have a few questions: I have already followed the procedure to download and ...
0
votes
1answer
183 views

Debian Stable (“wheezy”): was trying to build Python 3.4, and I ran sudo make install — am I in trouble now?

So, I wanted to run Python 3.4.x inside a virtualenv virtual environment. I learned that the first step should be to build Python 3.4.x. I was doing so in /usr/bin/Python3.4.x (a folder I created), ...
0
votes
0answers
33 views

Setting different path for installation in python packaging

I am new to python packaging. My Command Line Interface (CLI) named virtdc modules has to be installed in /var/lib/virtdc. virtdc is the top folder structure /var/lib/virtdc/ framework/ ...
0
votes
1answer
21 views

Permissions when creating a simple Python package for pip

I'm trying to package a simple app I wrote, so that it can be installed on a system using python setup.py install and (later) using pip install awesomeapp. The app consists of two files in the same ...
1
vote
0answers
27 views

Profiling memory, disk, cpu, and time from python

I have a workflow, implemented in python, and I would like to profile memory, disk (IO), cpu, and time information in python in an unobtrusive manner. This is NOT a question of profiling code, but ...
1
vote
2answers
76 views

Lots of unmet dependencies while updating Python

It was suggested that I uninstall and reinstall Python, so I deleted every directed labeled python until 'which python' and 'which python3.4' didn't show anything. Then I did apt-get remove python ...
6
votes
1answer
55 views

“ValueError: _system not initialized” when using apt.VersionCompare

I wrote a bash script that has to compare two version strings to decide to download new version or not. The test relies on a Python script that does apt.VersionCompare(), which does version comparison ...
0
votes
0answers
33 views

How to grant sudo permission for a .py script on a apache folder?

I've exemplo.py in an folder /opt/lampp/htdocs/cgi-local/exemplo.py folder. The script creates a socket that needs super user permissions. My question was a little confusing? I need to access ...
1
vote
0answers
20 views

How to monitor the integrity of a script that is running?

I want to make sure a running python script was not modified accidentally by some other process (or cosmic ray, or unexpected developer update). I've heard of comparing a checksum of the script (e.g. ...
3
votes
1answer
58 views

How to catch mount events on Linux?

I want to somehow get notified if a mount or unmount occurs for a USB drive. At the moment I use udev and then wait for x seconds for a new entry in /proc/mounts. This works ok if the mounting is ...
2
votes
1answer
61 views

readline - why does does it only do carriage return and not a line feed when reaching end of line?

I developped a python application that uses the cmd module to make an interactive command-line interface. This cmd module uses readline for command-line management: completion, history... My issue ...
16
votes
3answers
1k views

Why is coreutils sort slower than Python?

I wrote the following script to test the speed of Python's sort functionality: from sys import stdin, stdout lines = list(stdin) lines.sort() stdout.writelines(lines) I then compared this to the ...
-3
votes
1answer
115 views

What does PIP stand for? [closed]

What does pip stand for? Does it stands for Python Package Installer? No, I don't think so, it is PPI
6
votes
1answer
72 views

Why is this Python package trying to use a non-existent gcc?

I'm trying to install PyCrypto for Python 3 on Solaris. Whether I do it via "python3 setup.py install" or "pip3 install pycrypto", I run into the same problem: a call is made to a gcc which does not ...
1
vote
1answer
38 views

Pyajam in debian 7

I'm trying to make the installation package python Pyajam I tried to install for pip, I received an error 4Suite-XML package $ pip install Pyajam Installing collected packages: pyajam, 4Suite-XML ...
1
vote
1answer
50 views

How can I modify a python shared object (.so) file?

I have a python code (Running on a raspbian OS) which reads the value of a joystick axis and then sends the value to an arduino. At the start of the code I have typed: import pygame I can then use ...
10
votes
7answers
382 views

Why does my Python background process end when SSH session is terminated?

I have a bash script that starts up a python3 script (let's call it startup.sh), with the key line: nohup python3 -u <script> & When I ssh in directly and call this script, the python ...
1
vote
0answers
83 views

Startup commands in /etc/rc.local won't work

I have a Python program and an nginx/uwsgi/django web setup. I want the program to start with the system, as well as the web server. Here's my /etc/rc.local: crawler_dir=/home/mohammed/git/crawler ...
1
vote
0answers
35 views

writing into file using python [closed]

I am new using Python. So I have code here and tried to write in a file. When I run the code the only written in the file is only one line of word. But when I tried printing it into the screen it will ...
0
votes
1answer
41 views

Installing Python without package manager

I need to install Python 2.7.x on a TI Sitara ARM processor (based on the BeagleBone Black) running a minimal custom version of Linux. In particular, the OS does not have any package manager, no gcc, ...
1
vote
0answers
54 views

Hotmail not receiving emails from a script, but works from the server

I have a working mail server running Debian stable, the following elements are working. SPF DKIM rDNS My IP is not listed in any backlist, I used: mxtoolbox.com for all this. My problem: Sending ...
2
votes
1answer
68 views

Why is my pip-installed Python script not executable for everyone?

In my Vagrant instance: vagrant@archlinux:~$ sudo pip2 install vcard Downloading/unpacking vcard Downloading vcard-0.9.tar.gz Running setup.py (path:/tmp/pip_build_root/vcard/setup.py) egg_info ...
2
votes
1answer
36 views

Ways to store data for command line API

I am developing an API in Unix environment for virtual machines. I have to store some information in a table about virtual machines. Currently I am using python dictionary of virtual machine objects ...
3
votes
1answer
73 views

Issues with Skyperious

I am trying to install Skyperious on Ubuntu 13.10, I have installed all the required dependencies, my python version is Python 2.7.5+. When I run the following code from terminal python main.py ...
2
votes
1answer
20 views

How to use a custom library for certain programs?

Here's my situation. I'm running Centos 7, have the standard version of libcurl as provided by my package manager, and several programs that depend on libcurl. One of them is pycurl, a python ...
0
votes
0answers
32 views

Sage Math browser interface not working

I wanted to try Sage Math as an free alternative to MatLab. I installed it from AUR, and it works in terminal, but I can't access it via browser. I tried to Google it, but had no luck. ~> sage ...
1
vote
0answers
81 views

How to suppress input overrun messages

I have a Raspberry Pi running Raspbian (a Debian flavor: Linux version 3.12-1-rpi (debian-kernel@lists.debian.org) (gcc version 4.7.2 (Debian 4.7.2-5+rpi1) ) #1 Debian 3.12.9-1+rpi1 (2014-05-19) ). ...
1
vote
1answer
20 views

Maintain the path in installable UnixAPI

I am developing an API in Unix environment for virtual machines. Most of the modules are developed in python. I have few questions on this. Inside the API I am using absolute path like ...
0
votes
1answer
40 views

Make python module as an installable API

I am developing an API in Unix environment for virtual machines. Most of the modules are developed in python. I have few questions on this. I want to make this as an installable API, I mean to ...
3
votes
2answers
142 views

Basic steps to develop python API in Unix environment

I am developing an API in Unix environment for virtual machines. Most of the modules are developed in python. I have few questions on this. I have the file extension as abc.py. I would like to make ...