Change between Python 2.3 and 2.4 under WinXP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Franz Steinhäusler

    #1

    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)

  • Martin v. Löwis

    #2
    Re: Change between Python 2.3 and 2.4 under WinXP

    Franz Steinhäusler wrote:[color=blue]
    > Is there any possibility under WinXP, to alterntate quickly
    > (with batch file or similary) between python23 and python24.[/color]

    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\pyt hon.exe foo.py
    c:\python24\pyt hon.exe foo.py

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

    1. manually edit the registry. Under HKEY_CLASSES_RO OT,
    find Python.File (or Python.NoConFil e), then shell\open\comm and,
    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

    Comment

    • Peter Hansen

      #3
      Re: Change between Python 2.3 and 2.4 under WinXP

      Martin v. Löwis wrote:[color=blue]
      > Franz Steinhäusler wrote:[color=green]
      >> Is there any possibility under WinXP, to alterntate quickly (with
      >> batch file or similary) between python23 and python24.[/color][/color]
      [color=blue]
      > If you are concerned that the .py association changes, you
      > have two options:
      >
      > 1. manually edit the registry. Under HKEY_CLASSES_RO OT,
      > find Python.File (or Python.NoConFil e), then shell\open\comm and,
      > and switch between paths.[/color]

      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

      Comment

      • Cappy2112

        #4
        Re: Change between Python 2.3 and 2.4 under WinXP


        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

        Comment

        • Martin v. Löwis

          #5
          Re: Change between Python 2.3 and 2.4 under WinXP

          Cappy2112 wrote:[color=blue]
          > Do you really think this is a safe solution?[/color]

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

          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.
          [color=blue]
          > The imports have to be handled as well, and the dlls, and the libs too[/color]

          Yes. Using different interpreter binaries (i.e. \python23\pytho n.exe
          vs. \python24\pytho n.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

          Comment

          • Fredrik Lundh

            #6
            Re: Change between Python 2.3 and 2.4 under WinXP

            Franz Steinhäusler wrote:
            [color=blue]
            > 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.[/color]

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



            </F>



            Comment

            • Lucas Raab

              #7
              Re: Change between Python 2.3 and 2.4 under WinXP

              Fredrik Lundh wrote:[color=blue]
              > Franz Steinhäusler wrote:
              >
              >[color=green]
              >>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.[/color]
              >
              >
              > if you want to deploy programs that depend on a specific python version,
              > exemaker is your friend:
              >
              > http://effbot.org/zone/exemaker.htm
              >
              > </F>
              >
              >
              >[/color]

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

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

              Comment

              • Fredrik Lundh

                #8
                Re: Change between Python 2.3 and 2.4 under WinXP

                Lucas Raab wrote:
                [color=blue]
                > not to be biased toward your own products at all, or course :-)[/color]

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

                </F>



                Comment

                • Martin v. Löwis

                  #9
                  Re: Change between Python 2.3 and 2.4 under WinXP

                  Fredrik Lundh wrote:
                  [color=blue]
                  > I'm not aware of any other tool that solves that specific problem.[/color]

                  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 "alternatin g".

                  Regards,
                  Martin

                  Comment

                  • Franz Steinhaeusler

                    #10
                    Re: Change between Python 2.3 and 2.4 under WinXP

                    On Tue, 05 Apr 2005 01:53:25 +0200, "Martin v. Löwis"
                    <martin@v.loewi s.de> wrote:
                    [color=blue]
                    >Fredrik Lundh wrote:
                    >[color=green]
                    >> I'm not aware of any other tool that solves that specific problem.[/color]
                    >
                    >notepad does a fine job at creating batch files, IMO.
                    >
                    >Of course, it is not all that clear what the OP actually wanted.
                    >[...][/color]

                    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\pyt hon.exe should be enough)

                    thanks again!

                    --
                    Franz Steinhäusler


                    Comment

                    • rbt

                      #11
                      Re: Change between Python 2.3 and 2.4 under WinXP

                      Martin v. Löwis wrote:
                      [color=blue]
                      > 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"...[/color]

                      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?

                      Comment

                      • Thomas Heller

                        #12
                        Re: Change between Python 2.3 and 2.4 under WinXP

                        rbt <rbt@athop1.ath .vt.edu> writes:
                        [color=blue]
                        > Martin v. Löwis wrote:
                        >[color=green]
                        >> 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"...[/color]
                        >
                        > 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?[/color]

                        No.

                        2.4 and 2.3 (and other versions) can coexist.

                        Thomas

                        Comment

                        • Brian van den Broek

                          #13
                          Re: Change between Python 2.3 and 2.4 under WinXP

                          rbt said unto the world upon 2005-04-05 08:39:[color=blue]
                          > Martin v. Löwis wrote:
                          >[color=green]
                          >> 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"...[/color]
                          >
                          >
                          > 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?[/color]

                          Hi,

                          on a different thread

                          <http://groups.google.c a/groups?hl=en&lr =&safe=off&selm =42353d7d%240%2 419431%249b622d 9e%40news.freen et.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

                          Comment

                          • Fredrik Lundh

                            #14
                            Re: Change between Python 2.3 and 2.4 under WinXP

                            "Martin v. Löwis" wrote:
                            [color=blue][color=green]
                            >> I'm not aware of any other tool that solves that specific problem.[/color]
                            >
                            > notepad does a fine job at creating batch files, IMO.[/color]

                            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>



                            Comment

                            • Martin v. Löwis

                              #15
                              Re: Change between Python 2.3 and 2.4 under WinXP

                              Fredrik Lundh wrote:[color=blue]
                              > 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?[/color]

                              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

                              Comment

                              Working...