467,076 Members | 1,007 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,076 developers. It's quick & easy.

Change between Python 2.3 and 2.4 under WinXP

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,
--
Franz Steinhäusler

DrPython (Project Developer)
http://mitglied.lycos.de/drpython/
Jul 18 '05 #1
  • viewed: 1439
Share:
14 Replies
Franz Steinhäusler wrote:
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
Jul 18 '05 #2
Martin v. Löwis wrote:
Franz Steinhäusler wrote:
Is there any possibility under WinXP, to alterntate quickly (with
batch file or similary) between python23 and python24.
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
Jul 18 '05 #3

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

Jul 18 '05 #4
Cappy2112 wrote:
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
Jul 18 '05 #5
Franz Steinhäusler wrote:
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>

Jul 18 '05 #6
Fredrik Lundh wrote:
Franz Steinhäusler wrote:

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>


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
Jul 18 '05 #7
Lucas Raab wrote:
not to be biased toward your own products at all, or course :-)


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

</F>

Jul 18 '05 #8
Fredrik Lundh wrote:
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
Jul 18 '05 #9
On Tue, 05 Apr 2005 01:53:25 +0200, "Martin v. Löwis"
<ma****@v.loewis.de> wrote:
Fredrik Lundh wrote:
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!

--
Franz Steinhäusler
http://drpython.sourceforge.net/
http://mitglied.lycos.de/drpython/
Jul 18 '05 #10
rbt
Martin v. Löwis wrote:
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?
Jul 18 '05 #11
rbt <rb*@athop1.ath.vt.edu> writes:
Martin v. Löwis wrote:
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?


No.

2.4 and 2.3 (and other versions) can coexist.

Thomas
Jul 18 '05 #12
rbt said unto the world upon 2005-04-05 08:39:
Martin v. Löwis wrote:
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?


Hi,

on a different thread

<http://groups.google.ca/groups?hl=en&lr=&safe=off&selm=42353d7d%240%241943 1%249b622d9e%40news.freenet.de>

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

Jul 18 '05 #13
"Martin v. Löwis" wrote:
I'm not aware of any other tool that solves that specific problem.


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>

Jul 18 '05 #14
Fredrik Lundh wrote:
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
Jul 18 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

59 posts views Thread by Hugh Macdonald | last post: by
10 posts views Thread by Simon John | last post: by
3 posts views Thread by Godzilla | last post: by
28 posts views Thread by H J van Rooyen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.