[Tutor] Running multiple version of Python on 1 windows

Kent Johnson kent37 at tds.net
Wed Nov 1 12:07:07 CET 2006

Tony Cappellini wrote:
>  >From Kent
>  >>You don't say what OS you are running but under Windows it is trivial to
>  >>have multiple versions of Python installed, I have 2.3, 2.4 and 2.5.
>  >>They are each in their own directories, all in the system path. I have
>  >>aliases called py23, py24 and py25 that let me launch the version I
>  >>want. I'm pretty sure you can do something similar with other OSes.
> If you want script abc.py to run with python 2.3, and script xyz.py to 
> run with 2.5, how can you control this form the command line?

I have Python 2.3, 2.4 and 2.5 all installed on my PC. All three 
directories are in my PATH. As it happens Python2.4 is first in the path 
so if I just run 'python' I get Python 2.4.

In each Python directory I have a copy of python.exe that is named py2x; 
i.e. py23.exe, py24.exe, py25.exe. python.exe is small so I don't mind 
copying it; a shortcut would probably work as well. Since each dir is in 
the path, I can select which version to run by the name of the exe.
> python abc.py

py23 abc.py

> vs
> python xyz.py?

py24 xyz.py

> One task I'm faced with is evaluating the benefits of migrating a huge 
> framework from 2.3 to 2.4?
> I'd rather use two machines for this rather than install 2.4 on my 2.3 
> machine.
> If I need to make any changes in the scripts to work on 2.4, I don't 
> want that interfering with a fully-working 2.3 environment.

You should be able to have two copies of the scripts on your machine, a 
working production copy and a development copy.


More information about the Tutor mailing list