Using two pythons in an application

Rhamphoryncus rhamph at gmail.com
Mon Aug 4 23:04:52 CEST 2008


On Aug 3, 5:43 pm, Allen <brian_vanderbu... at yahoo.com> 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.

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.



More information about the Python-list mailing list