Change between Python 2.3 and 2.4 under WinXP

  • Thread starter Franz Steinhäusler
  • Start date
F

Franz Steinhäusler

Hello,

My second question from my last post (PyQt on Python 2.4), I think, is
a little got under (i have installed both Python 2.3 and Python 2.4)

Is there any possibility under WinXP, to alterntate quickly
(with batch file or similary) between python23 and python24.


Many thanks,
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Franz said:
Is there any possibility under WinXP, to alterntate quickly
(with batch file or similary) between python23 and python24.

No need to change between them. Just install them both, and
select which one to use on a per-invocation base. I.e. do

c:\python23\python.exe foo.py
c:\python24\python.exe foo.py

If you are concerned that the .py association changes, you
have two options:

1. manually edit the registry. Under HKEY_CLASSES_ROOT,
find Python.File (or Python.NoConFile), then shell\open\command,
and switch between paths.
2. install 2.4 and/or 2.3 under different user accounts, on
a per-user basis (rather than the per-machine basis), and
switch users. One of the installations can be per-machine,
as per-user settings override the machine settings for the
user.

Regards,
Martin
 
P

Peter Hansen

If you are concerned that the .py association changes, you
have two options:

1. manually edit the registry. Under HKEY_CLASSES_ROOT,
find Python.File (or Python.NoConFile), then shell\open\command,
and switch between paths.

Or even quicker: write a batch file that calls the
"ftype" command to change the registry setting.
(I believe changes made with ftype are persistent,
but haven't tested.)

Use "ftype /?" at a prompt to learn more, and try
"assoc .py" and "ftype Python.File" to learn more specifically
about what these do for Python.

-Peter
 
C

Cappy2112

Do you really think this is a safe solution?
How do you deal with features that are in new 2.4, but you invoke it
with the exe from 2.3?

The imports have to be handled as well, and the dlls, and the libs too
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Cappy2112 said:
Do you really think this is a safe solution?

Not sure which of the three solutions I mentioned you are referring
to as "this".
How do you deal with features that are in new 2.4, but you invoke it
with the exe from 2.3?

If you want to have the script run with both Python 2.3 and 2.4, you
should avoid using features new in 2.4. Alternatively, you can check
for the presence of the feature, and fall back gracefully if the feature
is missing.
The imports have to be handled as well, and the dlls, and the libs too

Yes. Using different interpreter binaries (i.e. \python23\python.exe
vs. \python24\python.exe) will automatically take care of this.
Each interpreter binary will safely have its own Python path, use its
own dlls, and its own libs.

Regards,
Martin
 
F

Fredrik Lundh

Franz said:
My second question from my last post (PyQt on Python 2.4), I think, is
a little got under (i have installed both Python 2.3 and Python 2.4)

Is there any possibility under WinXP, to alterntate quickly
(with batch file or similary) between python23 and python24.

if you want to deploy programs that depend on a specific python version,
exemaker is your friend:

http://effbot.org/zone/exemaker.htm

</F>
 
L

Lucas Raab

Fredrik said:
Franz Steinhäusler wrote:




if you want to deploy programs that depend on a specific python version,
exemaker is your friend:

http://effbot.org/zone/exemaker.htm

</F>

not to be biased toward your own products at all, or course :)

--
--------------------------
Lucas Raab
lvraab"@"earthlink.net
dotpyFE"@"gmail.com
AIM: Phoenix11890
MSN: dotpyfe "@" gmail.com
IRC: lvraab
ICQ: 324767918
Yahoo: Phoenix11890
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Fredrik said:
I'm not aware of any other tool that solves that specific problem.

notepad does a fine job at creating batch files, IMO.

Of course, it is not all that clear what the OP actually wanted.
For all we know, he wanted to "alternate quickly (with batch
file or similary) between python23 and python24". Taken in the
literal sense, selecting different versions of python.exe in
the start menu might be the fastest way of "alternating".

Regards,
Martin
 
F

Franz Steinhaeusler

Fredrik said:
I'm not aware of any other tool that solves that specific problem.

notepad does a fine job at creating batch files, IMO.

Of course, it is not all that clear what the OP actually wanted.
[...]

Hi, here I am again, the OP :)

I think, I considered the problem more complicated as it is in fact.

Maybe a batch file (py23.bat: c:\python23\python.exe should be enough)

thanks again!
 
R

rbt

Martin said:
Of course, it is not all that clear what the OP actually wanted.
For all we know, he wanted to "alternate quickly (with batch
file or similary) between python23 and python24"...

Maybe off-topic for this thread, but I noticed that when installing
2.4.1 that 2.4.0 is automatically removed. Does 2.4 do the same thing to
2.3 versions?
 
T

Thomas Heller

rbt said:
Maybe off-topic for this thread, but I noticed that when installing
2.4.1 that 2.4.0 is automatically removed. Does 2.4 do the same thing
to 2.3 versions?

No.

2.4 and 2.3 (and other versions) can coexist.

Thomas
 
B

Brian van den Broek

rbt said unto the world upon 2005-04-05 08:39:
Maybe off-topic for this thread, but I noticed that when installing
2.4.1 that 2.4.0 is automatically removed. Does 2.4 do the same thing to
2.3 versions?

Hi,

on a different thread

<http://groups.google.ca/groups?hl=en&lr=&safe=off&[email protected]>

Martin said that only one 2.4 version at a time is supported due to
there being only one python24.dll.

But the msi install process now informs you of this (thanks Martin :)

Best,

Brian vdB
 
F

Fredrik Lundh

Martin v. Löwis said:
notepad does a fine job at creating batch files, IMO.

have you used exemaker? have you compared the behaviour of the
resulting executables to batch files using different environments, shells,
and OS versions? or are you just guessing here?

</F>
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Fredrik said:
> have you used exemaker? have you compared the behaviour of the
resulting executables to batch files using different environments, shells,
and OS versions? or are you just guessing here?

I have invoked it once, but that was some time ago, and I did not do a
full case study of all its capabilities. In particular, I don't use
different environments, shells, or OS versions, so I cannot compare
the behaviour of the executables under circumstances different from
the ones on my machine(s). For the use cases that I guessed that the
OP was referring to, a batch file should be sufficient (actually,
the OP clarified that a "py23.bat" batch file was sufficient for
his needs).

Regards,
Martin
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top