Running a different copy of Python is as easy as starting the correct executable. You mention that you've started a python instance, from the command line, by simply typing python
.
What this does under Windows, is to trawl the %PATH%
environment variable, checking for an executable, either batch file (.bat
), command file (.cmd
) or some other executable to run (this is controlled by the PATHEXT
environment variable), that matches the name given. When it finds the correct file to run the file is being run.
Now, if you've installed two python versions 2.5 and 2.6, the path will have both of their directories in it, something like PATH=c:python2.5;c:python2.6
but Windows will stop examining the path when it finds a match.
What you really need to do is to explicitly call one or both of the applications, such as c:python2.5python.exe
or c:python2.6python.exe
.
The other alternative is to create a shortcut to the respective python.exe
calling one of them python25
and the other python26
; you can then simply run python25
on your command line.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…