Using two pythons in an application

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Allen

    Using two pythons in an application

    I'm in the process of developing an application that will use Python for
    a scripting support. In light of the upcoming changes to Python, I was
    wondering if it is possible to link to and use two different versions of
    Python so that in the future, scripts could be migrated to the new
    version, and older scripts would still work as well. If so are there
    any code examples of this.

    Brian Vanderburg II
  • Jorgen Grahn

    #2
    Re: Using two pythons in an application

    On Sun, 03 Aug 2008 14:01:49 -0400, Allen <brian_vanderbu rg2@yahoo.comwr ote:
    I'm in the process of developing an application that will use Python for
    a scripting support. In light of the upcoming changes to Python, I was
    wondering if it is possible to link to and use two different versions of
    Python so that in the future, scripts could be migrated to the new
    version, and older scripts would still work as well. If so are there
    any code examples of this.
    I cannot answer that, sorry.

    But if I were you, I'd pick a current, stable Python version for my
    application, and stop worrying for now.

    If there is a new, incompatible Python version (I assume you're
    talking about Py3k?) these things will happen:

    - people around the world will decide to migrate
    - people will gain experience with migrating Python code
    - Python 2.x will start to look obsolete
    - things like Linux distributions and web hosting companies will
    stop offering Python 2.x
    - you will be forced (for practical reasons, or to avoid looking silly)
    to migrate your application (and break old scripts)

    All this will happen *slowly* -- I believe so slowly that you will
    have plenty of time to act later. And your users (or whoever has to
    deal with the scripts) will not be alone; lots of people will sit
    around migrating old Python code.

    (Caveat: I don't know much about the Py3k transition, just about other
    cases like that. Killing off an old language dialect takes time!)

    /Jorgen

    --
    // Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
    \X/ snipabacken.se R'lyeh wgah'nagl fhtagn!

    Comment

    • Larry Bates

      #3
      Re: Using two pythons in an application

      Allen wrote:
      I'm in the process of developing an application that will use Python for
      a scripting support. In light of the upcoming changes to Python, I was
      wondering if it is possible to link to and use two different versions of
      Python so that in the future, scripts could be migrated to the new
      version, and older scripts would still work as well. If so are there
      any code examples of this.
      >
      Brian Vanderburg II
      Unlike languages you pay for, Python has on real motivation to "obsolete" old
      versions of Python (e.g. to force you to pay of an upgrade). You can still get
      version 1.5.2 of Python and it is MANY years old and most could consider quite
      obsolete. I just would not worry about it and stick with 2.5/2.6 for
      development and begin looking at Python 3.0 so I can learn what's new and exciting.

      -Larry

      Comment

      • Allen

        #4
        Re: Using two pythons in an application

        Larry Bates wrote:
        Allen wrote:
        >I'm in the process of developing an application that will use Python
        >for a scripting support. In light of the upcoming changes to Python,
        >I was wondering if it is possible to link to and use two different
        >versions of Python so that in the future, scripts could be migrated
        >to the new version, and older scripts would still work as well. If so
        >are there any code examples of this.
        >>
        >Brian Vanderburg II
        >
        Unlike languages you pay for, Python has on real motivation to
        "obsolete" old versions of Python (e.g. to force you to pay of an
        upgrade). You can still get version 1.5.2 of Python and it is MANY
        years old and most could consider quite obsolete. I just would not
        worry about it and stick with 2.5/2.6 for development and begin looking
        at Python 3.0 so I can learn what's new and exciting.
        >
        -Larry
        I agree. I had wanted for scripts of the program to be able to use the
        new string format method that is only in py3k, but I'm currently looking
        into other template solutions.

        Brian Vanderburg II

        Comment

        • Larry Bates

          #5
          Re: Using two pythons in an application

          Allen wrote:
          Larry Bates wrote:
          >Allen wrote:
          >>I'm in the process of developing an application that will use Python
          >>for a scripting support. In light of the upcoming changes to Python,
          >>I was wondering if it is possible to link to and use two different
          >>versions of Python so that in the future, scripts could be migrated
          >>to the new version, and older scripts would still work as well. If
          >>so are there any code examples of this.
          >>>
          >>Brian Vanderburg II
          >>
          >Unlike languages you pay for, Python has on real motivation to
          >"obsolete" old versions of Python (e.g. to force you to pay of an
          >upgrade). You can still get version 1.5.2 of Python and it is MANY
          >years old and most could consider quite obsolete. I just would not
          >worry about it and stick with 2.5/2.6 for development and begin
          >looking at Python 3.0 so I can learn what's new and exciting.
          >>
          >-Larry
          >
          I agree. I had wanted for scripts of the program to be able to use the
          new string format method that is only in py3k, but I'm currently looking
          into other template solutions.
          >
          Brian Vanderburg II
          There are many good ones around that you can look at:



          -Larry

          Comment

          • Rhamphoryncus

            #6
            Re: Using two pythons in an application

            On Aug 3, 5:43 pm, Allen <brian_vanderbu ...@yahoo.comwr ote:
            Larry Bates wrote:
            Allen wrote:
            I'm in the process of developing an application that will use Python
            for a scripting support.  In light of the upcoming changes to Python,
            I was wondering if it is possible to link to and use two different
            versions of  Python so that in the future, scripts could be migrated
            to the new version, and older scripts would still work as well.  If so
            are there any code examples of this.
            >
            Brian Vanderburg II
            >
            Unlike languages you pay for, Python has on real motivation to
            "obsolete" old versions of Python (e.g. to force you to pay of an
            upgrade).  You can still get version 1.5.2 of Python and it is MANY
            years old and most could consider quite obsolete.  I just would not
            worry about it and stick with 2.5/2.6 for development and begin looking
            at Python 3.0 so I can learn what's new and exciting.
            >
            -Larry
            >
            I agree.  I had wanted for scripts of the program to be able to use the
            new string format method that is only in py3k, but I'm currently looking
            into other template solutions.
            That should work in 2.6 (sans bugs).

            To answer your original question, no, you can't load more than one
            version of python within a single process. The best you can do is
            running in a child process.

            Comment

            • Jorgen Grahn

              #7
              Re: Using two pythons in an application

              On Sun, 03 Aug 2008 17:36:40 -0500, Larry Bates <larry.bates@we bsafe.com`wrote :
              Allen wrote:
              >I'm in the process of developing an application that will use Python for
              >a scripting support. In light of the upcoming changes to Python, I was
              >wondering if it is possible to link to and use two different versions of
              > Python so that in the future, scripts could be migrated to the new
              >version, and older scripts would still work as well. If so are there
              >any code examples of this.
              >>
              >Brian Vanderburg II
              >
              Unlike languages you pay for, Python has on real motivation to "obsolete" old
              versions of Python (e.g. to force you to pay of an upgrade). You can still get
              version 1.5.2 of Python and it is MANY years old and most could consider quite
              obsolete.
              Except at some point

              - security bug fixes will stop coming for very old Python releases
              - people will become used to the new, improved syntax and hate to use
              old versions
              - new versions of third-party modules will not be compatible with old
              releases

              So there *is* pressure to upgrade, sooner or later. But the time scale
              is several years, not months.
              I just would not worry about it and stick with 2.5/2.6 for
              development and begin looking at Python 3.0 so I can learn what's new and exciting.
              Yeah.

              /Jorgen

              --
              // Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
              \X/ snipabacken.se R'lyeh wgah'nagl fhtagn!

              Comment

              Working...