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

learn more… | top users | synonyms

3
votes
3answers
49 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 ...
-1
votes
2answers
47 views

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

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
21 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
269 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
41 views

python weather script not working [closed]

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
590 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
38 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
93 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
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
vote
1answer
352 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
56 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
28 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
25 views

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

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
121 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
33 views

DD-wrt serial messages [closed]

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 ...
0
votes
1answer
73 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
179 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
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
54 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
58 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
37 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 ...
24
votes
4answers
102k 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 ...
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
39 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 ...
4
votes
1answer
4k 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
27 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
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
26 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
31 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
78 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
85 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
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
89 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
33 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 ...
2
votes
1answer
145 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 ...
-3
votes
1answer
30 views

Online state change

Are there ready script in bash or python which pings target and reports only online state change? Also would nice to have average time between failures.
0
votes
0answers
26 views

Email user temporary code access code when using ssh

I am looking for a way to create my own two factor authentication for ssh. After the user enters the correct login info I would like the terminal to send an email to the user that contains a code ...
1
vote
1answer
79 views

How do I use GNOME Keyring with Python Keyring in virtual environment?

I have written a Python script that I would like to run in the background on my Raspberry Pi. The script makes use of the Python module Keyring (link), which is used to access a keyring backend to ...
2
votes
2answers
2k views

Can't import wx even after installing python-wxgtk2.8

I am running Linux Ubuntu 14.04 LTS and am trying to install wxPython so I can develop GUIs on python. I have python 2.7 and 3 installed but 2.7 in default. I have installed wxPython as recommended ...
0
votes
0answers
61 views

How to install PyGUI for Python3?

I want to install PyGUI for Python3 on Fedora 23. From PyGUI: Linux - requires pygtk (tested with pygtk-2.14.0 and Gtk+-2.14.7). And by going to PyGTK it says: Note: New users are ...
3
votes
3answers
65 views

Creating a self-contained installation file for pymssql for CentOS

I'm trying to deploy a Python application on a machine that due to system and organisation requirements can't have gcc installed on it, so I need to create a self-contained installation file for ...
2
votes
2answers
383 views

csvkit Permission denied

I am on Mac and installed csvkit. When I run csvlook, I get a traceback with the following error message: IOError: [Errno 13] Permission denied: '/Library ...
9
votes
5answers
3k views

How do I get 'realpath' to find my symbolic link?

I am on MacOSX using bash as my shell. I have symbolic link, created like this: ln -s /usr/bin/python python2 I have a package that uses python2 and I want to create a symbol link in my current ...
0
votes
0answers
40 views

Thumbor ImportError: No module named thumbor_plugins.optimizers.pngcrush

I'm strugling to properly install Thumbor on a server. I made my regular installation. Tested working at that time (Centos 7, Python 2.7.5) I setup supervisord to manage a deamon for thumbor I got ...
1
vote
1answer
6k views

Software Center not opening in Linux Mint

I'm a Linux Mint 14 user. I'm not able to open the software center. $ software-center ERROR:root:DebFileApplication import Traceback (most recent call last): File ...
-1
votes
3answers
81 views

Shell scripting : want to login on some server, which are in same domain and execute command and exit

I have 10 unix servers, I want to log into them one by one, execute 4-5 lines of code, save the output and exit. For Example: 10 serves: Intially at xyz server Login in server 1 --> execute 4-5 ...
1
vote
2answers
44 views

Wait until gnome-terminal ends

I'm trying to implement a script who runs four terminal window in parallel using this function gnome-terminal -e sh -c "python scraper.py". I would like to know if there's a way to wait until each ...