3.x and 2.x on same machine (is this info at Python.org??)

R

rantingrick

Hello,

Currently i am using 2.6 on Windows and need to start writing code in
3.0. I cannot leave 2.x yet because 3rd party modules are still not
converted. So i want to install 3.0 without disturbing my current
Python2.x. What i'm afraid of is that some SYSVARIABLE will get
changed to Python3.0 and when i double click a Python script it will
try and run Python 3.x instead of 2.x. I only want to run 3.0 scripts
from the command line... > python3.x myscript.py

So how do i do this? Is my fear unfounded?

Thanks
 
B

Benjamin Kaplan

Hello,

Currently i am using 2.6 on Windows and need to start writing code in
3.0. I cannot leave 2.x yet because 3rd party modules are still not
converted. So i want to install 3.0 without disturbing my current
Python2.x. What i'm afraid of is that some SYSVARIABLE will get
changed to Python3.0 and when i double click a Python script it will
try and run Python 3.x instead of 2.x. I only want to run 3.0 scripts
from the command line... > python3.x myscript.py

So how do i do this? Is my fear unfounded?

At least on *nix (including OS X), installing Python 3 does exactly
what you want by default. I don't know how it handles it on Windows.
 
T

Terry Reedy

rantingrick said:
Hello,

Currently i am using 2.6 on Windows and need to start writing code in
3.0. I cannot leave 2.x yet because 3rd party modules are still not
converted. So i want to install 3.0 without disturbing my current
Python2.x. What i'm afraid of is that some SYSVARIABLE will get
changed to Python3.0 and when i double click a Python script it will
try and run Python 3.x instead of 2.x. I only want to run 3.0 scripts
from the command line... > python3.x myscript.py

So how do i do this? Is my fear unfounded?

When you install 3.1 (not 3.0), it asks whether to make 'this' the
default Python. Make sure the box is unchecked.
 
R

rantingrick

When you install 3.1 (not 3.0), it asks whether to make 'this' the
default Python. Make sure the box is unchecked.

Thanks for both of your replies, just to be safe though i'm going to
back up everything ... Python 3000, here i come and i hope your ready
for me!?!?

Later Guy's!
 
D

Dan Bishop

Hello,

Currently i am using 2.6 on Windows and need to start writing code in
3.0. I cannot leave 2.x yet because 3rd party modules are still not
converted. So i want to install 3.0 without disturbing my current
Python2.x. What i'm afraid of is that some SYSVARIABLE will get
changed to Python3.0 and when i double click a Python script it will
try and run Python 3.x instead of 2.x. I only want to run 3.0 scripts
from the command line... > python3.x myscript.py

So how do i do this? Is my fear unfounded?

Windows determines the double-click action based on the file
extension. You just have to make sure that *.py files are associated
with 2.x.
http://support.microsoft.com/kb/307859
 
D

Dave Angel

Dan said:
Windows determines the double-click action based on the file
extension. You just have to make sure that *.py files are associated
with 2.x.
http://support.microsoft.com/kb/307859
And if someone simply wants to check or change these associations
without all the Explorer nonsense, one can use
assoc.exe and ftype.exe

Using them without parameters lists all association information. Using
them with parameters let you examine and/or change a single association.

M:\Programming\Python\sources\dummy>assoc .py
..py=Python.File

M:\Programming\Python\sources\dummy>ftype python.file
python.file="C:\PROGFI~1\ACTIVE~1\python.exe" "%1" %*


Similarly for .pyw extension

DaveA
 
N

Nobody

And if someone simply wants to check or change these associations
without all the Explorer nonsense, one can use
assoc.exe and ftype.exe

That isn't reliable.

The Windows registry has two distinct sets of mappings.

HKEY_LOCAL_MACHINE\Software\Classes contains system-wide mappings, while
HKEY_CURRENT_USER\Software\Classes contains per-user mappings. The
per-user mappings are checked first, with the system-wide mappings acting
as a fall-back. AFAICT, assoc and ftype modify the system-wide mappings,
so if you have a per-user mapping, they have no effect.

Note that HKEY_CLASSES_ROOT is a "virtual" key obtained by merging the
above two keys (analogous to a view in an RDBMS).

http://msdn.microsoft.com/en-us/library/ms724475(VS.85).aspx
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top