views:

47

answers:

3

I'm running Ubuntu to compile a set of code which requires python 2.4.

How can I setup a terminal launcher so that when I open that launcher all python related commands will use python 2.4 instead of the python 2.6 that is defaulted in Ubuntu?

+2  A: 

Invoke the interpreter via python2.4 instead of using the default.

Ignacio Vazquez-Abrams
+4  A: 

Set a bash alias in that shell session: alias python=python2.4 (assuming python2.4 is in your $PATH of course). This way you won't have to remember to explicitly type the 2.4 a zillion times in that terminal -- which is what bash aliases are for!-)

Alex Martelli
This is exactly what I was looking for thanks!
dirtytofu
A: 

For a permenant system wide change put a symbolic link to the version you want in place of /usr/bin/python. ie

rm /usr/bin/python; ln -s /usr/bin/python2.4 /usr/bin/python

gentoo has a program 'eselect' which is for just this kind of thing (listing versions of programs and setting the default), Ubuntu may have something analogous; you'd have to check their docs.

RyanD