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

learn more… | top users | synonyms

0
votes
0answers
5 views

Why Seeing Empty IPython Notebook in Full Directory?

I installed IPython and IPython-notebook by sudo apt-get install ipython ipython-notebook in Ubuntu 14.10. I run ipython notebook in a directory which has Cookbook project but I get in the internet ...
0
votes
1answer
851 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 ...
1
vote
3answers
27 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
0answers
33 views

Invoking Python program for each path in makefile vapth

I have a makefile as follows: VPATH = ../../HWP \ ../../hwsv/server \ ../hwpf PROC_INPUT_FILES = abc.c \ def.c \ xyz.c MEM_INPUT_FILES = ...
0
votes
0answers
24 views

Bash: Regex for validating web URLs [on hold]

I have been trying to use the following REGEX in BASH or within PYTHON. Still no luck. ...
11
votes
5answers
8k 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
36k 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
61 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
16 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
17 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 ...
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
34 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
6k 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
53 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
246 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
14 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 ...
0
votes
3answers
780 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 ...
-1
votes
3answers
42 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
17 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
15k 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 ...
7
votes
2answers
8k 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
19 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
18 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 ...
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 ...
2
votes
1answer
30 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
64 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
136 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
1answer
947 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
vote
2answers
24 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 ...
-1
votes
0answers
14 views

How can I trim the whitespace immediately preceding and following a given character in python? [migrated]

I have a bunch of strings that look like this s = '| this is | my | made up string ' I'd like to write a function that removes all the whitespace immediately preceeding and ...
3
votes
3answers
83 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
16 views

Comparing a set of IP addresses against subnets using python and netaddr module [migrated]

Can I pass file in "ip_list" and "banned_subnets". I have multiple list of IP's which need to be get match with multiple subnets, and it is not possible to list them all in script. For that I have ...
0
votes
0answers
13 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
16 views

Python syntax error running freshly installed `meld` [migrated]

I'm installing meld as described here: sudo yum install intltool itstool gir1.2-gtksource-3.0 libxml2-utils However, when I try to run meld this error appears: File "/usr/bin/meld", line 47 ...
3
votes
1answer
52 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 ...
0
votes
4answers
49 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 ...
0
votes
1answer
900 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 ...
2
votes
2answers
50 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 ...
0
votes
1answer
29 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 ...
0
votes
0answers
12 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 ...
1
vote
0answers
311 views

Python is unable to import OpenSSL

I created a virtual env for a matrix home server installation on a shared hoster. $ virtualenv -p python2.7 /home/tristank/venv/synapse $ source /home/tristank/venv/synapse/bin/activate I installed ...
0
votes
0answers
28 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
28 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 ...
13
votes
7answers
23k views

How to restart the Python script automatically if it is killed or dies

I am running my Python script in the background in my Ubuntu machine (12.04) like this - nohup python testing.py > test.out & Now, it might be possible that at some stage my above Python ...
0
votes
1answer
1k views

qmake error when installing PyQt5

I'm trying to install PyQt5 for python3 from source files. I install SIP correctly. Then when I want to prepare the make file for installing PyQt, I get this error: #python3 configure.py Error: ...
3
votes
3answers
392 views

How to use vim-slime from within a single tmux session?

I'm trying to integrate ipython and vim through a single tmux session using the popular vim plugin "vim-slime." The problem is that while I can get it to work fine provided that vim is opened in a ...
0
votes
1answer
754 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 ...
-1
votes
0answers
27 views

Python to Shell Script? [migrated]

How can I convert this simple python code to Shell script? import time import sys cur_time = int(time.time()*1000) print cur_time sys.exit(1)