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

learn more… | top users | synonyms

0
votes
0answers
18 views

Crontab and python script

On raspian I created a crontab file using the following command: sudo crontab -e Added the following lines to cron @reboot sudo /etc/init.d/cron start 0 * * * * sudo /usr/bin/python3 /home/pi/dev/...
0
votes
0answers
9 views

Drawing boxes around moving subjects SimpleCV [migrated]

I need to make a python program capable of using SimpleCV to identify up to 6 subjects (humans) in a certain area using 8 camera feeds. How can i identify the extremities of a subject and draw a box ...
-3
votes
0answers
33 views

Script (shell or python) to update a web page every 5 minutes [on hold]

I'm trying to write a script (shell or python) to update a web page every 5 minutes. I tried this: import time from selenium import webdriver driver = webdriver.Firefox() driver.get('https://www....
-1
votes
0answers
17 views

posix_spawn taking too much time to spawn a new python program from c++ [on hold]

I'm facing a problem where when I invoke my python program from c++ using posix_spawn it takes around 70ms-200ms based on how long main program was running. Is there anyway I can reduce this time, as ...
1
vote
1answer
40 views

Su as root and run command in one line

I need to su as root and run a command as a single line. This is for use in a python script. What I am looking for is: $ su root [some-magic] sh /home/jay/script-that-needs-executing-as-root.sh <...
0
votes
0answers
12 views

Running a function in parallel (in python) on clusters using different screens [migrated]

I have 2 functions which I need to run them in parallel written in python. The issue is that I'm running the code on the cluster, so first I open a screen and then I execute the python code. if ...
0
votes
0answers
38 views

Matplotlib not showing plot

The first time I wrote the import part was: import numpy as np import matplotlib.pyplot as plt and this threw error: (Constructor returned NULL). I searched here and one suggested to do this: ...
0
votes
0answers
8 views

How can I get urlopen to work with a list of urls from a file? [migrated]

I'm trying to get a list of urls from a file to work with urlopen so I can iterate through them and work with each url. I was able to do what I wanted perfectly with one url directly passed as an ...
0
votes
0answers
59 views

Bad host key from server — paramiko SSHException

I'm trying to connect to a remote host via pysftp: try: with pysftp.Connection(inventory[0], username='transit', private_key='~/.ssh/id_rsa.sftp', port=8055) as sftp: sftp.put('~/test.file') ...
0
votes
0answers
19 views

option conflicts between FPM and ./configure

Short version- trying to use FPM to make an RPM and the --python-blahblahblah flags seem to not be working. I think they are being overwritten by something else and I'm hoping someone who understands ...
0
votes
0answers
33 views

Installing Anaconda

I'm having trouble installing Anaconda for Python 2.7 on Elementary Freya 64 bit. I downloaded the sh file but when I type bash Anaconda2-4.1.1-Linux-x86_64.sh it keeps giving me the message "no such ...
0
votes
0answers
11 views

Debian 8.5.0 + Django: Module 'typing' not found

I'm using Django on Debian 8.5.0 with python3.4. I keep getting an Import Error on the line 'import typing': importerror: module 'typing' not found. I already installed module typing with pip install. ...
2
votes
1answer
38 views

yum Error: No module named site

I installed Greenplum on Centos 7 and now I cannot use yum. I need to install samba-client but when I run: yum install samba-client I see this error: ImportError: No module named site which ...
0
votes
0answers
51 views

How Troubleshoot Failed Installation of pywfdb from pip?

Condition: unable to troubleshoot failed installation of the library/module pywfdb from pip Differential conditions: failed dependenciens of pywfdb Exclude: upstart/systemd design bugs with runit in ...
4
votes
3answers
102 views

How to print same lines multiple times with variables changed using Sed/Awk/ anything?

a. Have set of lines as given below. cr_v8_sel0 : cross cp_v8_en, cp_sel0 { ignore_bins ig_v8_sel0 = binsof(cp_v8_en) && binsof(cp_sel0) intersect {[0:3],[5:$]}; } b. I wanted to print ...
1
vote
2answers
54 views

Location of automounted USB devices

I am creating a GUI app using tkinter and python. The app calls for a user to plug in a usb flash drive containing video files. I am launching the app with openbox. The USB does not seem to be ...
0
votes
0answers
18 views

Catfish: UnicodeDecodeError: 'locale' codec can't decode byte 0xe2 in position 9: Invalid or incomplete multibyte or wide character

Every time I try to search using catfish, I get this error in the terminal: ** (catfish:3457): CRITICAL **: atk_object_set_description: assertion 'ATK_IS_OBJECT (accessible)' failed Traceback (most ...
0
votes
1answer
43 views

Build a sitemap from local PHP forum pages

I've been reading stackexchange for years now, and always managed to find an answer to the problems I had to deal with. This time however, I'm going to ask a question as I could not find a solution to ...
1
vote
0answers
16 views

Glade gtk drag and drop tools

Glade is a program to create windows, panels, buttons... My question is does glade provide the tools to write apps for drag and drop. I've gone through the tools on the left side and couldn't find ...
3
votes
0answers
16 views

Block port on boot2docker vm on virtualmachine

I have Boot2Docker image running in VirtualBox on my mac. I use Kitematic to run docker on my Mac. I have activemq docker running, on port 32769 in boot2docker vm. I have application running which ...
0
votes
1answer
79 views

Installing Packages in PyCharm

I'm using Mint Cinnamon (very new) and tryign to get some packages in PyCharm. When I use the package installer for Numpy or Pandas I get the error message: collect2: error: ld returned 1 exit status ...
2
votes
2answers
64 views

How to check and run a script if it's not running?

I created a pretty simple script called main_start_script that will run 2 python programs in background, code is: python /opt/cuckoo/cuckoo-2/cuckoo.py 1>cuckoo_script/cuckoo_start.txt 2>&1 ...
4
votes
2answers
28 views

How can I make a udev rule using a “sibling” device's serial number (for USB devices with no unique serials)?

I have testing equipment that is made-up of the following: a USB Hub connected to the master PC, the hub is embedded in the test jig and is used so that we have only 1 USB cable running from the jig ...
1
vote
1answer
27 views

Force dpkg repair

I did a terrible mistake and deleted two folders from the /usr/lib directory on my Debian. I deleted python2.7/ and pkgconfig/ Things I've tried to fix it without success: sudo dpkg -i python2* -> "...
0
votes
1answer
76 views

Can't run some Python programs after Debian upgrade

I did apt-get dist-upgrade yesterday and now I get the following error when I try to run anki: Traceback (most recent call last): File "/usr/bin/anki", line 5, in <module> import aqt ...
0
votes
1answer
27 views

How to sandbox code in chroot for multiple users?

What am I trying to do? I'm writing a code evaluator using chroot and python and went to hackerrank for some inspiration. What I think is happening at Hackerrank? Hackerrank creates run-...
1
vote
2answers
163 views

zipimport.ZipImportError: can't decompress data; zlib not available

On RHEL 6.6, I installed Python 3.5.1 from source. I am trying to install pip3 via get-pip.py, but I get Traceback (most recent call last): File "get-pip.py", line 19177, in <module> ...
0
votes
1answer
85 views

yum is broken because of missing Python module (RHEL 6.4)

When I run $ yum I see: There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: /usr/lib64/libssh2.so.1: symbol EVP_aes_128_ctr, ...
0
votes
0answers
25 views

Shell script invoking python does not resume on MacOS

I have a shell script that invokes Python on my MacOS. After that invocation completes successfully, the script execution is not continued by terminated: curl "https://s3.amazonaws.com/aws-cli/...
0
votes
1answer
31 views

Various scripts I see will not run through python

I am very confused as to why I get syntax errors when attempting to run scripts such as the one contained in the answer below: How do I download PDFs from PubMed, given their IDs? Am I not supposed ...
0
votes
0answers
16 views

server load and performance testing

Dears, there are some cluster of servers that are responsible for a telecommunication company databases. the OS's was Linux Redhat installed on bare metal till now, but all the clusters are migrating ...
2
votes
0answers
22 views

How do you install Django when there is a problem with scl?

scl is installed on RedHat 6. The man pages for scl work. I want to install Django. I believe that a prerequisite is to install SCL for Python. $scl -l returns nothing. I believe that this is ...
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 ...
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 ...
3
votes
1answer
24 views

Can't use global shorcuts for Python applications

I'm using bash on a Mac. My problem is every time I try to run an installed Python application I just get a message that the command can't be found. Like so: -bash: gcloud: command not found Doesn'...
1
vote
0answers
34 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
59 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 ...
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 ...
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 ...
1
vote
1answer
58 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
39 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
27 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
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 ...
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. ...
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 ...