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

learn more… | top users | synonyms

1
vote
3answers
50 views

how to spawn a separate process in the background while running a foreground process

e.g., I want run a python -m HTTPSimpleServer in the background while running a watch in the background python -m HTTPSimpleServer; watch -n (my awesome test command) how can I run both in ...
0
votes
1answer
62 views

CentOS: How to force pip to install Django with latest Python 3.5

I'm running CentOS, and it has pre-installed Python 2.6.6. But I want to use Python 3.5, the latest version. So I have installed Python 3.5 on my server. It's working properly. I just compile Python ...
0
votes
0answers
31 views

save outputs and errors to external file from lxterminal

I run compiled python program like this on my linux box (runs automatically after start lxterminal LXDE lxsession autostart): @lxterminal -e sudo /home/user/app.exe > /home/user/app.out 2>&...
2
votes
1answer
55 views

Systemd Python service not sending all output to syslog

I have a custom service and have explicitly called for all stdout & stderr to be sent to syslog in the config file, however only some of the output appears in both syslog and the journal (they are ...
2
votes
0answers
30 views

Why does tar list multiple entries for some files? [duplicate]

In a folder with a single file (image.jpg) I run the following commands $ ls -a . .. image.jpg $ tar cf target.tar image.jpg Listing contents of the archive $ tar tvf target.tar -...
0
votes
1answer
47 views

Running a discord.py, pyenv python 3.5.1 script on an apache2 webserver

I'm running into difficulty getting a python based discord bot to run on my apache2 webserver. I'm using the discord.py api wrapper and I installed python 3.5.1 using pyenv. Here is my code #!/usr/...
0
votes
3answers
34 views

How to make python3 the default version on WING IDE

I'm new to python and I've been trying to update from python 2 to 3 by doing apt-get install python3 and it installed but when I type python --version on my terminal the version is 2.7.9. How can I ...
-1
votes
3answers
45 views

Insert array of years into a list of URLS

I have a list of URLS like the example below. /test/test I also have an array of years [1999, 2000, 2001]. I am trying to find a way to automate the task of printing out a list of URLS with ...
1
vote
0answers
41 views

PyOpenCL on Linux Mint: PLATFORM_NOT_FOUND_KHR

I've been trying to get PyOpenCL and PyCUDA running on a Linux Mint machine. I have things installed but the demo scripts fail with the error: pyopencl.cffi_cl.LogicError: clgetplatformids failed: ...
2
votes
1answer
48 views

can't find documentation on json.tool [closed]

I can find scattered articles online that use json.tool to produce pretty python, but no clear documentation on usage. I checked docs.python. but there is no formal documentation of json.tool. I ...
2
votes
2answers
112 views

Why won't this bash command run when called by python?

The command $ find ~/foo/ -type f -iname "*.txt" -print0 | parallel -0 cat uses GNU Parallel to print all the .txt files under ~/foo/. I have a python script where I want to call this bash ...
1
vote
2answers
29 views

Can python extract org-mode tables from org documents?

I'm trying to write some python code that reads specified tables in org mode documents. For example, I have a file ~/foo.org $ cat ~/foo.org #+Title: Example Org Document * Section One Proin quam ...
3
votes
3answers
118 views

How can I get a python script to “remember” user input?

I have a script that asks the user for the path to their desired directory default_path = '/path/to/desired/directory/' user_path = raw_input("Enter new directory [{0}]: ".format(default_path)) or ...
0
votes
0answers
19 views

How to restore initial configuration, files… of python on Linux Mint

Due to a mistake when compiling Python sources (Python 2.7.11), my Python installation is broken. I can solve the problem partially by recompiling the initial version of Python (2.7.6). This solution ...
0
votes
0answers
15 views

bpython installation trouble

I have a problem with bpython: studio@linux:~> sudo pip install bpython==0.15 Requirement already satisfied (use --upgrade to upgrade): bpython==0.15 in /usr/lib/python3.4/site-packages ...
0
votes
0answers
94 views

wkhtmltopdf and pdfkit issues in python

Hello I am developing an web with python Flask in a linux server, in doing so I am trying to use pdfkit and wkhtmltopdf. I am using a linux server(ubuntu). In Putty, after logging into my server, at ...
0
votes
0answers
72 views

How to install linux-gpib Python bindings inside virtual environment?

I'm working on developing Python code to control GPIB devices, and am realizing the more I learn the less I know. So here's my question: I believe I've installed linux-gpib properly, and I have ...
0
votes
1answer
57 views

NS-3.25 PyViz visualizer install on CentOS 6.5

I'm installing Network Simulator 3.25 on a CentOS 6.5 machine. In my environment I cannot use any repository, every single packet have to be downloaded from a machine and then transferred to the ...
2
votes
2answers
90 views

Make python file accessible from anywhere by all users

I installed a program that requires you to execute a python script like this: python fit_locus.py --help I want to make the file acessible to all users without requiring them to navigate to the ...
3
votes
1answer
63 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
3answers
54 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
vote
0answers
11 views

Installing Python modules on ChromeOS

Is there any way you can download Python modules in ChromeOS without accessing developer mode? I am using a student Chromebook that blocks access to developer mode.
-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
23 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 data =" ::ED." ...
1
vote
0answers
73 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: http://...
0
votes
1answer
40 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 ...
1
vote
0answers
27 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.
2
votes
1answer
55 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
1answer
159 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 ...
0
votes
4answers
84 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 python-...
2
votes
1answer
361 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. ...
0
votes
2answers
50 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 ...
3
votes
0answers
34 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
152 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, ...
1
vote
1answer
19 views

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

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 ...
0
votes
1answer
62 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
142 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
65 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 ...
0
votes
2answers
47 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 ...
0
votes
0answers
48 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 /usr/...
0
votes
0answers
29 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
35 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
166 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
126 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 2.7....
0
votes
1answer
23 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
133 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
50 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
27 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 ...
2
votes
1answer
159 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 ...
0
votes
1answer
13 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 ...