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

learn more… | top users | synonyms

12
votes
2answers
6k views

Best way to upgrade vim/gvim to 7.3 in Ubuntu 10.04?

I have to use Ubuntu 10.04 at work, and cant upgrade it. I'm using Vim/gVim 7.2. I want to upgrade it to 7.3 (with Python and Ruby extension support). Which is the best way? Add an entry in ...
8
votes
5answers
1k views

How can I have more than one possibility in a script's shebang line?

I'm in a bit of an interesting situation where I have a Python script that can theoretically be run by a variety of users with a variety of environments (and PATHs) and on a variety of Linux systems. ...
23
votes
3answers
7k views

How does /usr/bin/env know which program to use?

When I use the shebang #!/usr/bin/env python to run a script, how does the system know which python to use? if I look for a python bin path in the environment variables I find nothing. env | grep -i ...
7
votes
4answers
7k views

Why is this python error message generated whenever I type a nonsense command?

Whenever I type any "nonsense" command, this python error message is generated. Normal commands work fine. Any idea how to debug this? $ somenonexistingcommand Traceback (most recent call last): ...
1
vote
3answers
550 views

How to install easy_install using non-default Python Interpreter on CentOS?

I have downloaded, compiled and installed Python 2.7 on CentOS. I would like to download and install easy_install (and pip) for it but I am a little bit confused as to how to do that. How can I ...
14
votes
5answers
7k views

Using different versions of Python

Background: Since I develop python programs that must run on different python versions, I have installed different versions of python on my computer. I am using FC 13 so it came with python 2.6 ...
25
votes
4answers
2k views

python vs bc in evaluating 6^6^6

I am evaluating the expression 6^6^6 using python and bc separately. The content of the python file is print 6**6**6. When I execute time python test.py, I get the output as real 0m0.067s ...
1
vote
3answers
209 views

Distributions that only ships Python 3.X

Is it possible currently? I tried to remove python in Fedora 19 but yum depends on it.
2
votes
1answer
127 views

Change the default shell to Python

If I changed my default shell from BASH to Python3 or IPython, would my Linux system have issues or produce errors?
13
votes
2answers
8k views

What is the proper way to manage multiple python versions?

I have a machine with Python 2.6 installed as the default Python. Then, I installed Python 2.7, and manually created /usr/bin/python as a symlink to the new installation. Then, I was running into ...
9
votes
2answers
5k 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 ...
3
votes
1answer
260 views

Reading amount of tracks from an audio CD?

I'm writing a little script to analyze audio CDs. I'm specifically looking for a way to grab the track count from the CD, either from a shell-script or from Python. Is there an easy way to do this? ...
2
votes
1answer
4k 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 ...
0
votes
1answer
591 views

Upgrading Python 2.6. libpython2.6.so.1.0 missing

I am upgrading python on an offline 64bit RHEL 6.4 box and am having to do it via RPM's rather than yum. I am trying to upgrade python from 2.4.3 to 2.6 so I can build nodejs from source. I am ...
7
votes
1answer
866 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 ...
5
votes
3answers
258 views

How can you change the process name of Wing IDE from python to something more descriptive

In my process list under Ubuntu (using top/System Monitor) one of the largest memory hogs (200+Mb) was python. I searched a bit for one of my programs to be the cause until I realised this was my ...
3
votes
2answers
196 views

case sensitive substitution; same target ids

I am struggled myself to make a case sensitive replacement in a text file. Please find below a segment of my sed file that I am running as sed -f file.sed < input.txt > output.txt ...
3
votes
4answers
2k views

Running python script from Linux Terminal

I have downloaded this script named, pyAES.py and put it in a folder name codes, inside a Desktop directory of my Linux, According to this example, ...
2
votes
3answers
735 views

Unmet dependencies

I am trying to compile vim and install with "--enable-pythoninterp" flag, which needs the python-dev package. INFO I obtained the vim source from ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2 Vim7.3 ...
1
vote
2answers
83 views

How to change the default version of Python in Debian 7.5?

I'm using Debian 7.5, and I've installed Python 3.3 and 3.2. How do I make 3.3 the default for when someone types python in the command line?
1
vote
2answers
224 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?
1
vote
1answer
162 views

How can I install hulahop

I cloned hulahop via git and I'd like to use it and try to run this example. I have a problem to find out how to build and install it. I also tried to install it with apt-get but I don't have this ...
1
vote
1answer
180 views

Python in GNOME code base

Is Python present in the Gnome code base? If so, how is it involved? Note: My question concerns the core GNOME Desktop Environment only (e.g. nautilus, gnome-session, NetworkManager) and any ...
0
votes
1answer
25 views

Python: Move lines backward in a textfile

Imagine a text file which contains random text and two unique markers 01 text text text 02 text text text 03 __DELETE_THIS_FIRST__ 04 text text text 05 text text text 06 text text text 07 text text ...