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

learn more… | top users | synonyms

3
votes
2answers
214 views

Aliasing 'python' to 'ipython' only when 'python' is run without args

I thought it would be nice to have an alias (in ~/.zshrc) to have 'python' aliased to 'ipython' ONLY when 'python' is run without args (otherwise, programs won't launch). First of all, how to express ...
3
votes
1answer
2k views

Upgrade matplotlib to 1.2 or 1.3

I am trying to upgrade my python matplotlib but for some reason I can't get it to upgrade. I originally installed matplotlib with: apt-get install python-matplotlib which was fine. However it ...
1
vote
1answer
372 views

Managing the output streams of many subprocesses with deadlocks

I have a Python script that does more or less this current_tasks = TaskManager() MAXPROCS = 8 while len(outstanding_tasks) > 0: if len(current_tasks.running) < MAXPROCS: ...
0
votes
3answers
240 views

apt-get install packages for python2.7

Whenever I install a package for python it only installs for Python2.6 which came with the Debian 6. I am wondering how do I install for python2.7 with apt-get. Presently I am downloading the tarballs ...
2
votes
1answer
126 views

What is the source of truth for currently active tty/pts connections?

I'm looking for a simple way to determine the number of currently logged in users, using only the filesystem and basic bash functions (instead of using binaries). The uptime binary appears to be ...
2
votes
4answers
1k views

CUPS - check if print successful (either python or in system)

EDIT: I forgot to make it clear I'm using python and pycups. The code is python but I shouldn't have thought that was enough. I've dug through the cups documentation a few times and couldn't find ...
5
votes
1answer
144 views

Correct handling of Python2 and Python3

What is the correct way running scripts that depend on python2.x but on a system where python3.x is aliased with python. The solution should take into account the following things : Python2 ...
2
votes
0answers
54 views

Losing sound after installing wine 1.5 (+python 2.7)?

I have a desktop and a laptop computer. Since I wanted to run IrfanView (that works great now!), I installed wine 1.5.22, which involved installing 1 GB of dependencies. The desktop continues to work ...
1
vote
2answers
203 views

how to install ast python package

I'm using django constance in my project. This app used a python package ast. When I try to install that package using command pip-2.7 install ast, it results as "Could not find any downloads that ...
1
vote
0answers
267 views

Python bindings for libtorrent-rasterbar are not working on debian

I'm running Debian 6.0.6 I've downloaded latest version of libtorrent-rasterbar from here: http://code.google.com/p/libtorrent/downloads/detail?name=libtorrent-rasterbar-0.16.6.tar.gz&can=2 and ...
7
votes
1answer
1k views

Problems running python script from motion

I'm trying to set up the raspberry pi with my webcam as a motion detecting cctv that uploads the videos to google drive using Jeremy Blythe's script I have motion working correctly and the python ...
1
vote
1answer
60 views

What to include in an RPM created from python packages

I'm looking to create a rpm for this tarball and couldn't figure out which files needed to be included in the package after the install. I am used to compiling some code and including the binary ...
1
vote
1answer
108 views

Virtual Python installation not allowing ez_setup?

I don't have root on my system, so I'm trying to create a virtual Python installation. I ran virtual-python.py, and it told me to run ez_setup.py. I found it online and ran it with the command ...
1
vote
3answers
307 views

I want to run commands like make, make install, python setup install without changing directories

I have written a script which will download software from the internet to the current user's home directory and then untar it. And then I have to make and make install it and in some software I have ...
1
vote
3answers
1k views

How to run a Python script in Makefile

I want to write a Makefile to find specific files and run a Python script on each file. The Python script accepts sys.stdin input. find $(W)/$(OVE) -name "*.xml" -print | \ while read x ; do \ cat ...
2
votes
1answer
205 views

When I am in VirtualEnv and do apt-get install, is there any difference?

If I have a virtualenv activated when I do something like sudo apt-get install python2.7-dev should I expect different results than if I did it outside the virtual env? Limited theory says no, ...
1
vote
2answers
711 views

Running google cloudprint on boot

I use this Python script on my Debian based Guru Plug to make it work as a print server for Google Cloudprint. With this I can print from my Android devices using apps like PrinterShare or Cloud ...
3
votes
1answer
51 views

How to determine the current Enhanced Zoom factor in Compiz?

When I use Skype :( need to, rather than want to ), I find that I sometimes want to open the main menu, but it doesn't have a shortcut key assigned to it (well, not one that I can find). I have ...
0
votes
1answer
269 views

Sublime Text 2 not detecting python library if installed in /opt

I am attempting to install Sublime Text 2 in /opt/sublime_text. Once all the files are in there, I believe the executable not detecting the python libraries and throwing the following error: I ...
2
votes
2answers
14k views

How to properly install Python packages?

I run a Slackware system and I'm trying to run some Python code, but getting a lot of errors such as this one below: >>> import urllib2 Traceback (most recent call last): File ...
1
vote
4answers
1k views

pysqlite install error on FreeBSD in virtualenv

I am trying to install pysqlite using pip under a virtualenv in FreeBSD 7.3, with Python version 2.6.2. I didn't have any issues for installing other packages like Django, PIL etc. All of them I ...
4
votes
1answer
2k views

Using Atlas from scipy

I installed Ubuntu 12.04 64 bit. I need to work with python and scipy, I installed them and when I run the test: python -c "import scipy; scipy.test()" I get the message: ImportError: ...
5
votes
1answer
243 views

Using OGG/Vorbis, is there a way to continue to record to an existing audio file?

I am using Vorbis/ogg to record audio (using arecord and then pipping to oggenc). I have downloaded oggvideotools, which gave me oggCat, which will let me join two previously recorded audio files into ...
3
votes
3answers
308 views

Is there an equivalent of calling the built-in python function help('topics') but in bash?

I would like to explore man pages in bash using something similar to the python help('topics') function. Does this exist in bash? I know the bash equivalent of python's help('modules') would look ...
2
votes
1answer
438 views

Installing trac - “Trac requires Python 2.5 or later”

I am having a little trouble getting trac 1.0 installed via easy_install: [box]# easy_install Trac==1.0 Downloading ...
0
votes
1answer
580 views

Simple python web server doesn't execute CGI scripts

I set up a simple python web server by opening a terminal in a directory and doing python -m CGIHTTPServer There is a CGI script in the directory but when I type into the browser ...
2
votes
1answer
613 views

Replace python built with UCS4 with UCS2

I've got fedora fc15 installed with python 2.7.1-7.fc15. It is built with ucs4 and I've got some packages here at work that are built with ucs2. I now cannot build other packages that use these ucs2 ...
0
votes
0answers
287 views

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

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 ...
4
votes
6answers
378 views

What is the easiest way to check if column A and B values goes both ways with AWK? [closed]

What is the easiest way to check if column A and B values goes both ways? Output to check: Mike John John Mike Pamela Barbara Barbara Pamela Mike Paul Roger Paul Desired output Mike <-> ...
1
vote
2answers
664 views

What scripting language or platform to use for web page downloads and screen interaction? [duplicate]

Possible Duplicate: Does anybody here have experience in automating some tasks in web applications using curl? Here is what I need to do? Wondering what platform is most suited - easy to ...
7
votes
3answers
2k views

How do I make python programs behave like proper unix tools?

I have a few Python scripts laying around, and I'm working on rewriting them. I have the same problem with all of them. It's not obvious to me how to write the programs so that they behave like ...
2
votes
1answer
600 views

Subprocess.call() and gunzip error

I'm trying to use Python's package subprocess to gunzip and gzip files. I'm using the following command: subprocess.call(['gunzip', a_path+myfile_gz], shell=True) Then I get the error message: ...
3
votes
1answer
978 views

Can I upgrade to a new version of Python on an old version of Ubuntu?

I have Ubuntu 8.04.3 LTS and ran this: $ sudo apt-get install python2.7 I got this: Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find ...
3
votes
0answers
166 views

Enable sqlite FTS Enhanced Query Syntax in python in RHEL6?

SQLite's full text search engine offers a simple query syntax (with AND and OR operators and -term for negation), as well as an enhanced query syntax which also allows parenthesis and NEAR — as well ...
1
vote
2answers
244 views

loading python when the linux kernel boots

I was reading This and I was wondering if I could write an API in python or have python load in an init script. If this were to be possible would I need to edit the kernel's makefile?
3
votes
2answers
353 views

Print row contain maximum and minimum value

I need to read the file (contains 16K rows)and print the entire row if any of columns and all columns contains max value (100) and all columns contain min value (0).The ouput example is given ...
3
votes
2answers
2k 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
0answers
90 views

How do I fix my FastCGI Pinax / Django deployment?

I'm running OSX Lion (posted here because this is a Unix-specific question), and am trying to deploy a Pinax project via FCGI. I have the FastCGI daemon running: $ ps wwaux | grep fcgi jonathan ...
1
vote
0answers
167 views

How do I satisfy the “warnings” Pinax requirement?

I'm trying to build a Pinax virtualenv. I get, on Precise Penguin with 0.7: jonathan@ubuntu:~/Downloads/Pinax-0.7-bundle/scripts$ ./pinax-boot.py ~/virtual New python executable in ...
1
vote
2answers
1k views

Python script to shutdown system doesn't work in cron

A python script to shutdown system works fine from the terminal but doesn't work when included in crontab. The script is called by cron but ends with an error 'shutdown command not found'or 'init 0 ...
1
vote
3answers
6k views

How to change the working directory for a shell script

I have a Python script that looks files up in a relative directory. For example: the Python script is in /home/username/projectname/. I have a file that is being called within the Python script that ...
2
votes
1answer
164 views

emacs python2.7

I would like to have emacs work as a python ide for me. I can't seem to find how to compile from within emacs. I'm using python2.7 but when I do M-x python-mode it seems to compile using python2.7. Is ...
5
votes
2answers
2k views

On Debian, how do I add a Python package in dist-packages to a virtualenv?

Given some python package in /usr/share/pyshared/ or /usr/lib/pythonX.Y/dist-packages/ (take python-numpy or python-scipy for example), how do I add that package to a virtualenv? When adding the ...
1
vote
0answers
76 views

How to access storage device related events with Zeitgeist?

I am trying to get my mind around Zeitgeist, using the Python DBus API. To get the latest accessed files and application is not so hard, here is what I do: #! /usr/bin/env python from ...
4
votes
5answers
5k views

How can I upgrade pip on Ubuntu 10.04?

On Ubuntu 10.04 I've used apt-get install pip to install pip after which I installed django. Then I tried to uninstall django with pip via pip uninstall django which gives me: pip: error: No command ...
3
votes
1answer
223 views

Suddenly I have troubles plotting with python

I have a code that I used yesterday to generate plots. Today, when I tried to use it (with the same input as yesterday), I get an error: QGtkStyle was unable to detect the current GTK+ theme. ...
0
votes
1answer
3k views

How to manually uninstall urllib, urllib2, requests python packages?

I'm having a problem with urllib, urllib2 and requests, three python libraries. I use Ubuntu 10.04.4 LTS and python 2.6.5 (we can use with python) (but I had installed manually, after the problem, ...
3
votes
3answers
654 views

Why does installing python-minimal package also grab the python package on Debian?

From running: apt-cache depends python2.6-minimal | grep Depends and apt-cache depends python2.6 | grep Depends it looks like python2.6 depends on python2.6-minimal and a lot more. However, ...
0
votes
1answer
84 views

Install new most recent python package in ubuntu?

I could really do with installing matplotlib 1.1.0 on my ubunutu 11.10 system. The current ubuntu package is at 1.0.1, how do I use the new one?
0
votes
1answer
825 views

zlib support for PIL won't work

I'm trying to install PIL as per its instruction on debian but can't figure how to fix this bit: I get --- ZLIB (PNG/ZIP) support available on build_ext and * ZLIB (PNG/ZIP) support not installed on ...