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

learn more… | top users | synonyms

1
vote
2answers
4k views

Linux Mint 13 Problem - No module named site

My Linux Mint 13 64-bit system has developed a problem. Whilst I can run basic commands like ls and vi if I try anything more complex (I have tried python2.7, mysql-workbench and addusr) I get:- ...
0
votes
2answers
805 views

How to monitor the screen lock/unlock in the Ubuntu 14.04

I need to implement a function that monitors the screen lock/unlock. I referred to the following article: Run script on screen lock/unlock My python script code works fine in Ubuntu 12.04, but it ...
0
votes
0answers
24 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/...
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
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
5answers
669 views

How can I disable the new history feature in Python 3.4?

Since upgrading to Python 3.4, all interactive commands are logged to ~/.python_history. I don't want Python to create or write to this file. Creating a symlink to /dev/null does not work, Python ...
0
votes
3answers
1k 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
vote
1answer
256 views

OfflineIMAP tells me SQLite isn't installed, even though it is

Whenever I run OfflineIMAP v6.5.3.1 I get an error for every folder (i.e. tag and folder in Gmail) which tells me there was a problem and then right after it tells me: SQLite backend chosen, but no ...
-3
votes
0answers
35 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
1k views

Unable to use python speech_recognition lib Microphone class due to ALSA

I am attempting to write a speech recognition program for the raspberry pi, however I am facing some issues using python's speech_recognition library. From the error messages (posted below) I think ...
1
vote
2answers
55 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 ...
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 <...
1
vote
1answer
1k 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 ...
2
votes
2answers
66 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 ...
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
60 views

LSF bsub implementation of LUT

We have an implementation of LSF (bsub) on our HPC system. I want to run a model several times with various input parameters. I will have a table either csv or other format with the required ...
0
votes
0answers
39 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
447 views

mod_python won't “./configure” because it can't determine httpd version [closed]

I'm trying to install mod_python 3.3.1 on Apache 2.4.3 and whenever I try to run ./configure (with apxs etc) and instead of configuring correctly, it says that Apache 2.x is required and my current ...
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
76 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
1answer
1k 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 ...
0
votes
0answers
36 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 ...
1
vote
1answer
483 views

lxml with custom install location for libxml2/libxslt doesn't find correct location

I am using CentOS 6.5 and want to use newer versions of Python, lxml, libxml2 and libxslt2 than what's available from the repos. So I build libxml2, libxslt2 and python 2.7.8 from scratch, and add ...
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. ...
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 ...
2
votes
1answer
42 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
1answer
2k 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: /...
4
votes
3answers
105 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 ...
4
votes
2answers
29 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 ...
0
votes
1answer
234 views

FreeBSD Selenium PhantomJS - Can not connect to the Service

i am stuck to run PhantomJS with selenium. So i have prepared a FreeBSD Jail and installed phantomjs via ports. whereis phantomjs > phantomjs: /usr/local/bin/phantomjs /usr/ports/lang/phantomjs /...
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 ...
0
votes
1answer
131 views

Need script to kill python process with low CPU usage

I've created a very large and complex python program and I now know it has a serious bug that I'm having a very hard time pinning down. I'm using this code in a production environment so I need a stop-...
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 ...
0
votes
1answer
1k views

Debian Stable (“wheezy”): was trying to build Python 3.4, and I ran sudo make install — am I in trouble now?

So, I wanted to run Python 3.4.x inside a virtualenv virtual environment. I learned that the first step should be to build Python 3.4.x. I was doing so in /usr/bin/Python3.4.x (a folder I created), ...
1
vote
3answers
183 views

about executing a python program in a shell script which is scheduled on crontab

i have a problem with regards on crontab. I have a script named checker.sh and i want to schedule it that would run every minute: * * * * * sh /home/pi/checker.sh so i have the script here: the ...
1
vote
2answers
194 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> ...
2
votes
1answer
1k views

New files and folders created, automatically inherit same permissions as parent folder

Does it exist? I create a folder with, let's say, all permissions set, and some services (i.e. Apache web server) create subfolders and put files there (uploaded media files from website users). Such ...
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 ...
2
votes
2answers
4k views

FreeBSD: How to install Django with mod_wsgi?

Using FreeBSD 8.2-RELEASE. I want to mess around with Django and I want a working setup on my freebsd system. My understanding is I need to install python, apache, mod_wsgi, and django. The ...
0
votes
1answer
81 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 ...
0
votes
1answer
78 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 ...
1
vote
1answer
163 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
2answers
666 views

import: unable to open X server `' @ error/import.c/ImportImageCommand/361

I am trying to run a python script to generate heatmap and clustering dendrogram. But I got an error message saying : import: unable to open X server @ error/import.c/ImportImageCommand/361 I am a ...
2
votes
3answers
553 views

Do I have multiple python on my computer? and how to uninstall one of them?

I encountered the problem that pip install - U numpy did not update the numpy version in python, which is similar to http://stackoverflow.com/questions/26390895/why-isnt-pip-updating-my-numpy-and-...
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
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-...
2
votes
0answers
24 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 ...