Switching between Python releases under Windows

E

Edward Diener

I have multiple versions of Python installed under Vista. Is there any
easy way of switching between them so that invoking python and file
associations for Python extensions files work automatically ?
 
U

Ulrich Eckhardt

Edward said:
I have multiple versions of Python installed under Vista. Is there any
easy way of switching between them so that invoking python and file
associations for Python extensions files work automatically ?

These associations are stored in the registry. Just cut out the according
sections[1] with the settings for each Python version and save them in a
file each. You can then simply re-import the variant with the settings that
you need in order to change. Note that these .reg files are just text
files, so you can also change them using a text editor if there is need.

Uli

[1] e.g. HKEY_CLASSES_ROOT\Python.File
 
T

Tim Golden

I have multiple versions of Python installed under Vista. Is there any
easy way of switching between them so that invoking python and file
associations for Python extensions files work automatically ?

Well, the answer depends a bit on how au fait you are with fiddling
with env vars etc. but, if it helps, this script:

https://winsys.googlecode.com/svn/trunk/random/associate.py

will set the version of Python which runs it as the default.
If you're running on Vista/W7, you'll probably need to run it
with a param of "user" or inside an Elevated command prompt.

TJG

(Won't work w/ Python 3 without a bit of tweaking)
 
T

Tim Golden

Well, the answer depends a bit on how au fait you are with fiddling
with env vars etc....

But essentially involves:

* Adding c:\pythonxy and c:\pythonxy\script to PATH

* assoc .py=python.file [probably already done]

* python.file="C:\Pythonxy\python.exe" "%1" %*


TJG
 
S

Sridhar Ratnakumar

But essentially involves:

* Adding c:\pythonxy and c:\pythonxy\script to PATH

FWIW, ActivePython automatically does this. As it includes versioned
binaries as well, one can type (just like on Unix) `python2.7.exe` or
`python3.2.exe` in the Command Prompt.
* assoc .py=python.file [probably already done]

* python.file="C:\Pythonxy\python.exe" "%1" %*

I suppose I should soon implement Windows support in pythonselect,
https://github.com/Activestate/pythonselect

-srid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top