473,503 Members | 12,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Aug 3 '08 #1
6 842
On Sun, 03 Aug 2008 14:01:49 -0400, Allen <br***************@yahoo.comwrote:
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!
Aug 3 '08 #2
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
Aug 3 '08 #3
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
Aug 3 '08 #4
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:

http://www.webwareforpython.org/Papers/Templates/

-Larry
Aug 4 '08 #5
On Aug 3, 5:43*pm, Allen <brian_vanderbu...@yahoo.comwrote:
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.
Aug 4 '08 #6
On Sun, 03 Aug 2008 17:36:40 -0500, Larry Bates <la*********@websafe.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!
Aug 5 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2507
by: ForHimself Every Man | last post by:
What's better about Rattlesnakes than Python. I'm sure there's something. What is it? This is not a troll. I'm a snake shooping and I want people's answers. I don't know beans about...
12
1644
by: f29 | last post by:
I don't believe that noone has yet spotted that python is becoming java. Each new version is fully equipped with more garbage than before. Classes are great, but once there are 1000 of them,...
5
2163
by: Mathias Panzenboeck | last post by:
Hi. I wrote a small hashlib for C. Because I'm new to hashes I looked at pythons implementation and reused *some* of the code... or more the mathematical "hash-function", not really the code. ...
2
1601
by: Carl J. Van Arsdall | last post by:
I'm aware of a couple python projects for embedded systems. I am currently considering using Python on an embedded platform to develop a simple application as a personal project, mostly to see if...
1
1409
by: tedpottel | last post by:
Hi, I am creating a library of functions. I would like to have them saved in a sub folder of pythons LIB folder, but I cannot get it to work. I have a script called test.py I stored it in...
6
1998
by: tedpottel | last post by:
Hi, I'm trying to create my own lib of functions, but it seems like I can only import them if they are in pythons lib folder. Example I have a folder called K:\mypython Now in the...
5
1419
by: aha | last post by:
Hello All, I have a situation where I can count on a Python installation being available on a system, but I can't count on it being a version of Python needed by my application. Since my...
0
815
by: Ivan Ven Osdel | last post by:
>Hello All, Simplest case: Obviously things can be shortened by adding to the PATH. Ivan Ven Osdel Software Engineer
12
4854
by: cnb | last post by:
>>sys.path Now I have my personal programs in C:/Python25/Progs/ How do I add so that I can just do "import somefile" from anywhere in that directory in the interpreter and it can load files...
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7296
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5604
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.