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

learn more… | top users | synonyms

0
votes
3answers
987 views

Python3.4 package for Debian Wheezy

I'm looking for a way to get python3.4 for debian wheezy. I've been looking on repos but all I could find is 3.2 version. Does anybody know where I can find 3.4 package? (Or maybe does anybody know ...
2
votes
3answers
660 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; /...
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 "...
0
votes
1answer
24 views

How do i run my python file from any directory on my computer [Arch]

I am currently trying to run gprof2dot on the gmon.out created by using the -pg option while compiling. Now I have already done pip install gprof2dot. How am I supposed to run this on the gmon.out ...
1
vote
1answer
26 views

Enable SCL python27 so other RPMs can see it

Trying to create an RPM that uses Python 2.7 on a RHEL 6 machine. I'm using SCL to enable Python2.7 and building the RPM with it fine. However, when I try to install that RPM on a different system ...
0
votes
0answers
31 views

My python code does not print histograms in the terminal as designed

I'm using Cygwin64 Terminal to run a Linux putty to conduct scientific analysis. I have little to no experience programming experience. I am trying to run an analysis program to using python code and ...
1
vote
0answers
33 views

How to install mailman when it needs an older version of Python?

I am working on an install of mailman 3.0.3 on Ubuntu Server 16.04 which ships with Python 3.5.1 and 2.7.11. Per Barry Warsaw that version of mailman requires Python 3.4.n. https://gitlab.com/mailman/...
1
vote
0answers
23 views

How do I run a supervisor command in a Eclipse PyDev project without being asked for a password?

So I've got the following code that should check whether an npm package is installed: def is_installed(name, as_global=True): # Returns whether NPM package is installed. s = shell(...
1
vote
1answer
58 views

pass arguments to python program in shell

I am unable to run python script within a shell script. Following is the script.sh file where 3 arguments are being passed to the python script. python main.py 1.0 0.1 10 The python program is not ...
0
votes
0answers
91 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 ...
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.
0
votes
1answer
58 views

I installed python 2.7 on RHEL6 server, want to go back to 2.6

I am on RHEL6 and I installed python27 using these commands: sudo sh -c 'wget -qO- http://people.redhat.com/bkabrda/scl_python27.repo >> /etc/yum.repos.d/scl.repo' sudo yum install python27 ...
3
votes
2answers
71 views

obtain shell prompt in python

I want to obtain the (zsh) shell prompt in a python script. Simply using import os prompt = os.environ['PS1'] seems not to be the right way, because PS1 is usually not forwarded to subprocesses. In ...
6
votes
4answers
5k views

Sending the output from 'dd' to awk/sed/grep

I'm trying to approximate the computer's write speed using dd: dd if=/dev/urandom of=/dev/null bs=1K count=10000 which gives the following output 10000+0 records in 10000+0 records out 10240000 ...
1
vote
1answer
57 views

Updating Python on CentOS

I am running 64 bit CentOS 7 on an Oracle VirtualBox. The CentOS ISO that I downloaded came with Python 2.7.5 and I am trying to update to 2.7.11, but the normal steps are not working. I downloaded ...
0
votes
1answer
9 views

python3-pyds9 package missing in Jessie

In Sid there is a package python3-pyds9 but it seems this disappeared in Jessie. How do I get ds9 package for Python in Jessie?
0
votes
0answers
36 views

Trying to use Python SpeechRecognition on Ubuntu 14.04 but flac-linux-x86 not found

When I try to run the example script audio_transcribe.py on my Ubuntu 14.04 virtual machine I get a FileNotFoundError: [Errno 2] No such file or directory. The thing is, I can see the exact file ...
0
votes
1answer
16 views

Switching from a downloaded version of python to a Homebrew one

I've recently decided I'd like to switch from my downloaded versions (as in downloaded from python.org) of python 2 and 3 to Homebrew installs. I've installed both python 2 and 3 from Homebrew using a ...
1
vote
1answer
25 views

What is ${PYTHON_REL} FreeBSD

I have an error whilst making a port, so I checked the makefile, and found the problematic line. The issue is that I don't know how to fix it, as I don't know how to change the Python_Rel variable. ...
1
vote
1answer
60 views

How to find my pip? [closed]

Yesterday I installed the pip with python get-pip.py and it can be regular used. Now it shows this. -bash: pip: command not found so I try to use python get-pip.py to install it again. ...
-1
votes
1answer
63 views

I SSH into a linux server via putty, and i have a linked drive on my windows machine. How can I access files on other drives?

I am using a linux server to run scripts and manage a database. I get to this using a SSH through PuTTY. On my windows machine there is a mapped drive to a directory (/mapped_drive/) on this server (X:...
0
votes
1answer
29 views

Is there such a notion as broadening where find searches?

I'm trying to identify redundant installations of the site package matplotlib in my python3.5 environment. A contributor to the library (GitHub issue) is advising that I use python3.5 -m site ...
0
votes
1answer
785 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 ...
8
votes
5answers
19k 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, ...
0
votes
3answers
47 views

How do non-interactive programs get the permission to edit files in /etc

I'm writing a program in python that needs to edit some files in /etc. Some system some its own. How do I get those permissions from within the program itself without running sudo as the program ...
1
vote
1answer
1k 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 "/usr/local/lib/python2.7/dist-packages/...
1
vote
3answers
49 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 ...
11
votes
5answers
9k views

How can I rename photos, given the EXIF data?

Let's say I have a bunch of photos, all with correct EXIF information, and the photos are randomly named (because of a problem I had). I have a little program called jhead which gives me the below ...
8
votes
2answers
39k views

Running Python on ChromeOS

Is it possible to run the Python interpreter on a ChromeOS machine? I've found various editors you can use, but I would like the ability to run python applications as well. I would like to purchase ...
2
votes
1answer
74 views

What is wrong with my systemd unit file?

Here is my unit file: [Unit] Description=Backend Service After=mariadb.service Requires=mariadb.service [Service] Type=simple ExecStart=/var/www/html/pythonscripts/Backend.py [Install] Alias=BEd ...
0
votes
1answer
61 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>&...
1
vote
2answers
2k views

Adding ALSA module in Python in Linux

I have recently started working in linux, I wanted to to add ALSA module in my Python. I have used this, sudo apt-get install libasound2-dev After that I've installed pyalsa package, pyalsa ...
2
votes
1answer
54 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 ...
8
votes
4answers
7k views

Hybrid code in shell scripts. Sharing variables

This answer discusses how to run a multi-line Python snippet from the command line in a terminal. I noticed that the answer works great within shell scripts, even with nested indentation, which is ...
1
vote
3answers
95 views

Program cannot resolve host name if it's started before first successful internet connection

This is related to a stackoverflow post I posted. Basically I have a Python script that I'm running on an embedded system (Buildroot-based). The python script runs on startup, but I cannot guarantee ...
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 -...
2
votes
2answers
344 views

installing dsc30 - python 2.6 fights back

I'm trying to upgrade some systems to Cassandra 3.x. The installer wants Python(abi) >= 2.7, so I installed it. Still seeing this error: Resolving Dependencies --> Running transaction check --->...
0
votes
1answer
46 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/...
-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 ...
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 ...
0
votes
2answers
16k 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 https://github.com/tgalal/yowsup/archive/master....
7
votes
2answers
9k views

How to install meld 3.11 in Ubuntu 14.04?

I am trying to get meld 3.11 to work on ubuntu 14.04 I tried following the method below" cd ~ git clone https://git.gnome.org/browse/meld cd meld sudo ln -s ~/meld/bin/meld /usr/bin/meld But ...
1
vote
0answers
39 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: ...
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 ...
2
votes
1answer
47 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
110 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 ...
0
votes
1answer
163 views

Why won't MOTD display output from a Python script it calls outside of /etc/update-motd.d/ unless it's in this directory?

The Situation We're running a headless Ubuntu 14.10 Server to fulfill various needs and tests. I was experimenting with changing the MOTD for SSH sessions via /etc/update-motd.d/ so as to display ...
1
vote
0answers
1k views

CentOs7 Python 3.4 Install Method

This post relates to this question where I was asked to explain how I installed python3 on my system. I was attempting to install python3 on my system for development purposes. Something went wrong ...
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 ...