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

learn more… | top users | synonyms

2
votes
1answer
28 views

Create table with frequency of unique names retrieved from multiple .csv files

I have 32 CSV files containing fetched information from a database. I need to make a frequency table in TSV/CSV format, where the names of the rows are the name of each file, and the names of the ...
3
votes
2answers
27 views

Sudo-like remembrance of passwords for own scripts

I have a script which requires a password for authenticating a web service. A single password for a pre-defined user will suffice, and the password should if possible be stored securely (not plain ...
0
votes
2answers
38 views

Where can I practice my Python and Bash scripting? [on hold]

I wanted to practice my bash scripting skills and python skills and wanted a good book or a site where I can practice and get excellent skills please. Any recommendations please.
0
votes
1answer
18 views

Including milliseconds in a Script?

sudo hexdump -v -e '1/1 "%02x\n"' /dev/ttyUSB0 | awk '$1=="ed" { getline byte1 getline byte2 number = strtonum("0x" substr(byte2,2,1))+2 ...
0
votes
1answer
265 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 ...
2
votes
1answer
2k 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
0answers
29 views

python weather script not working [on hold]

i am using archlinux with openbox. I created a pipe menu with a python script to get the weather from yahoo. at the begining it worked fine, but then it stopped working. the python file: ...
1
vote
1answer
563 views

Receiving “Unable to correct problems, you have held broken packages.” after trying to install python -setuptools and python-pip

I ran "sudo apt-get install python-setuptools python-pip" but I received: Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be ...
0
votes
1answer
34 views

How to replace a text in a shell executable file (.sh) using Python?

I have xxx.sh file which content is: setsid ./start-meteor.sh >> /home/farah/StudioInstallation/Studio/bricks/platform/log/databricksastro.log 2>&1 < /dev/null & I want to ...
0
votes
1answer
88 views

Start GTK apk based on Python

How to start application based on Python + Glade? startx python apk.py is not working. I can run application like Firefox from text mode: startx firefox
0
votes
1answer
772 views

RuntimeError: You need gevent installed to use this worker

I need gevent to run docker-registry but i have this error: Error: class uri 'gevent' invalid or not found: [Traceback (most recent call last): File ...
0
votes
0answers
15 views

Pip managed python extending distribution packaged modules

I am looking for recommendations on extending the python library managed by my arbitrary distribution with packages available via PPI. Basically I have been working with a distro managed installation ...
-1
votes
0answers
14 views

Get my current path using a python script as a command [migrated]

I put a python script to my /usr/local/bin to use as a command in bash. I want to use my bash working directory, but I only get the current directory where the script is executed. Is there a way to ...
0
votes
3answers
24 views

Should we let Python pip overwrite modules that were installed by RPM?

Python pip and many Python modules are provided through the CentOS Linux repos. On CentOS 7.x Linux, I can install pip and pymongo with the standard distribution package manager (yum install ...
1
vote
1answer
341 views

Modoboa 1.1.1 Deployment Errors

I tried to install modoboa follow this steps: http://modoboa.readthedocs.org/en/latest/getting_started/install.html I installed modoboa with pip install modoboa: Traceback (most recent call last): ...
1
vote
0answers
26 views

Installing Anaconda on a Chromebook

So I'm not sure if this is the right place for my question since I'm using Chrome OS, but I've put it in developer mode and opened a shell, which looks very reminiscent of a Unix shell. I've never ...
2
votes
1answer
18 views

File permissions while installing a python module

I would like to install sphinx-doc from the sources so I git clone the module then installed it with sudo python setup.py install. Using /usr/local/lib/python2.7/dist-packages/pytz-2016.4-py2.7.egg ...
1
vote
0answers
14 views

Can I do socket programming in Python on a Chromebook with Crouton? [on hold]

The idea is to run a simple server on a Chromebook. Does Crouton afford that much control? I might not actually write the server in python but it'd be nice to know whether it's possible.
0
votes
2answers
49 views

python virtual environment

I have to install python package locally/globally on a machine using pip, so for I do not want to install pip on local machine. I can successfully create a new virtual environment using easy_install ...
2
votes
1answer
47 views

Systemd: How to start/stop Python script that should run in background, inside Virtualenv

On my Raspbian machine, I want a successful OpenVPN connection to my VPN provider to initiate a Python script, that persistently should run in the background as long as the VPN connection is active. ...
3
votes
0answers
29 views

DD-wrt serial messages [on hold]

Since I recently bricked my WDR3600 by accidentally flashing wrong firmware with mdt I had to do some soldering to make serial work. Since the window to entering bootloader cmd was really short I ...
-2
votes
0answers
15 views

How can I make these improvements to this code [migrated]

I want to improve the code below so if the user types in an integer in the name question an error alert message tells the user to input there name again not integer. In addition how can I can a code ...
0
votes
1answer
39 views

Python psutil version conflict for Terminator on Centos 7

This issue started after latest updates installation, probably in last 2-3 days. When I try to open Terminator I get error, Traceback (most recent call last): File "/usr/bin/terminator", line 23, ...
2
votes
3answers
1k views

How can I replace bash with 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 ...
13
votes
2answers
175 views

How do I activate Xorg record module on Raspbian?

I'm trying to automate some tests on my RaspberryPi and I'm using python's pymouse to perform some emulated clicks. On my Debian it works fine, but when it comes to Raspbian it keeps failing with this ...
1
vote
1answer
15 views

Trying to get .py scripts running through apache (mod_python) [on hold]

All the tutorials say to look for <directory...> </directory>, but I cannot find this in my default 000-default.conf (on my raspberry pi). Can someone explain what I am supposed to do? All ...
1
vote
0answers
30 views

Is it normal that I need u+w to set extended filesystem attributes?

I noticed that on panfs, Python's copystat fails when the source file does not have the u+w permission bit set; setting attributes fails with Permission denied command line equivalent: (attr_set: ...
0
votes
1answer
51 views

How do I calculate the column percentage of a file?

I have a tsv file that contains some values. I want the sum of each column and total number of values and percentage values. Eg: file.tsv contains x 1 1 0 1 x x 1 x ...
1
vote
0answers
16 views

Fatal Python error: pycurl: libcurl link-time version is older than compile-time version

When updating yum via sudo on our (Amazon Linux) server, I get the following error: Fatal Python error: pycurl: libcurl link-time version is older than compile-time version I find the following ...
1
vote
0answers
24 views

Start my webpy server using supervisor

I am trying to start my python web.py server at boot, but I am having difficulties getting it running by itself. I have a config-file like the following. It's basically the sample file with an added ...
23
votes
4answers
97k 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 ...
4
votes
2answers
6k 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 ...
3
votes
3answers
18k views

How to change the working directory for a shell script

I have a Python script that looks files up in a relative directory. For example: the Python script is in /home/username/projectname/. I have a file that is being called within the Python script that ...
0
votes
2answers
31 views

How to compile C Extension for Python

I am attempting to install https://github.com/lthiery/SPI-Py (on a Raspberry Pi running Raspbian) by running sudo python setup.py install This fails with error spi.c:20:20: fatal error: Python.h: No ...
1
vote
1answer
825 views

CentOs 7 Python Issue “-bash: python: command not found”

I asked this at stackoverflow, but just realized it might be best here. If I need to delete it over there or should not have posted here, please let me know. I am still new to this site. Thanks in ...
-1
votes
0answers
4 views

lp only prints blank page without fit-to-page option

I am trying to print graphs made with matplotlib and saved as pdfs. With only lp file.pdf a blank page prints. With lp -o fit-to-page file.pdf then the graph prints but its obviously the entire page ...
4
votes
1answer
3k views

Help me repair my python - I think dpkg has to be reset (very tricky issue)

first question in Unix & Linux - I really hope, someone can help... Summary (TL;DR) On my Kubuntu 14.4 (which has python 2.7.6 as standard) my python is broken after I tried to install python ...
0
votes
0answers
17 views

Terminator installed via Homebrew “Incompatible library version”

I've installed Terminator from the homebrew/gui tap, but when I ran it, it raised this error: You need to install the python bindings for gobject, gtk and pango to run Terminator. I edited ...
0
votes
1answer
824 views

Yum Corrupted on RHEL 6

I really need help. I am encountering the issue with my yum command. It seems to be exactly the same as the issue described on this site, Yum corrupted on CentOS 6.2, Problem importing one the python ...
0
votes
1answer
10 views

Create Multiple libvirt Volumes From One XML File

I'm using libvirt's virsh vol-create command to create multiple volumes. I've started using Jinja2 templates to help with automating the task for a specific application. In my case, it would help ...
0
votes
0answers
24 views

Enabling Yum Repos in Python

I have a set of scripts that automatically downloads packages from yum using the internal Python bindings on Centos 7. These work fine until I need to enable a repo during a package download. I've ...
1
vote
0answers
26 views

How to use a tty as a sound device for pjsua?

I have a bi-directional PCM device that appears as /dev/ttyUSBxx. It provides and consumes 16-bit linear PCM at 8KHz (though that can be changed to u-LAW or a-LAW). I would like to use the device in ...
1
vote
1answer
49 views

How / Is it possible to install python in a portable way?

I'm working on a python script which takes care to migrate a mysql database with a certain schema / structure, into a postgresql database with a different structure. During the development phase I ...
0
votes
2answers
62 views

How do I install Python in Linux with no Internet access?

Part 1 I have CentOS with no Internet access. I have a docker container based on Ubuntu. I want to install Python inside the Docker container. I downloaded some .deb files for installing Python ...
0
votes
1answer
742 views

Django can not connect to MySQL database over ubuntu 10.04

I am newbie in Django. I got a simple Django 1.3.* project, i would like to run it over my localhost. I installed all necessary modules like: python-mysqldb, rptz etc... I have ubuntu 10.04 ...
0
votes
1answer
17 views

Pitfalls to symlinking python2.7 to python?

I have a CentOS 6.7 machine with the "system" python (2.6.6) installed from an RPM at /usr/bin/python. We installed an additional version installed from source (2.7.11) used for development purposes ...
0
votes
0answers
60 views

Write to terminal in Tkinter GUI

I am trying to show the changes in the command line in real time in my Tkinter GUI, I managed to create the GUI and integrate the terminal into it, but I cant bind the buttons with the terminal, my ...
0
votes
0answers
29 views

can't run any python 2 programs due to encoding error

After a system update, I'm not able to run any python 2 program. I get the error. UnicodeDecodeError: 'utf8' codec can't decode byte 0xf6 in position 203: invalid start byte python3 says it uses ...
0
votes
0answers
6 views

Removing items in one array based on whats in another array - python [migrated]

I'm trying to make a function that removes items from all_cards based on whats in the iss_answer array. My iss_answer array will change often in my program so I can't just type ...
1
vote
1answer
72 views

No module named yum

I am facing errors while running any yum commands on centos 7 system No module named yum Please install a package which provides this module, or verify that the module is installed correctly. It's ...