Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Switching between Python releases under Windows

Reply
Thread Tools

Switching between Python releases under Windows

 
 
Edward Diener
Guest
Posts: n/a
 
      03-08-2011
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 ?
 
Reply With Quote
 
 
 
 
Ulrich Eckhardt
Guest
Posts: n/a
 
      03-08-2011
Edward Diener wrote:
> 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
--
Domino Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

 
Reply With Quote
 
 
 
 
Tim Golden
Guest
Posts: n/a
 
      03-08-2011
On 08/03/2011 14:55, Edward Diener wrote:
> 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/tr...m/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)
 
Reply With Quote
 
Tim Golden
Guest
Posts: n/a
 
      03-08-2011
On 08/03/2011 15:58, Tim Golden wrote:
> On 08/03/2011 14:55, Edward Diener wrote:
>> 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 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
 
Reply With Quote
 
Sridhar Ratnakumar
Guest
Posts: n/a
 
      03-22-2011
On Tue, Mar 8, 2011 at 8:03 AM, Tim Golden <(E-Mail Removed)> wrote:
> On 08/03/2011 15:58, Tim Golden wrote:
>>
>> On 08/03/2011 14:55, Edward Diener wrote:
>>>
>>> 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 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Process Switching vs. Fast/CEF Switching? asdf Cisco 7 05-29-2007 05:26 PM
Looking for superior Canadian DVD releases vs. U.S. releases Calidore DVD Video 1 10-25-2004 11:36 AM
New Releases: Re-releases Saving Pvt Ryan D-Day anniversary: Updated complete downladable R1 DVD DB & info lists Doug MacLean DVD Video 0 02-28-2004 05:17 AM
New Releases: Next week's releases, status changes: Updated complete downloadable R1 DVD DB & info lists Doug MacLean DVD Video 0 12-30-2003 05:37 AM
Trouble Switching Between Windows Robert H. Risch Computer Support 3 08-28-2003 03:15 PM



Advertisments