473,550 Members | 2,881 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wanted: a python24 package for Python 2.3

Hello

My problem is that I want a Python 2.4 module on
a server that is running Python 2.3. I definitely
want to use the 2.4 module, and I don't want to
require the server to move to Python 2.4.

More exactly, I am using subprocess, which is
new in Python 2.4. What I am writing is something
like
===
from subprocess import Popen
===

This will fail in Python 2.3, in which case I
would like to write something like
===
try:
from subprocess import Popen
else ImportError:
from somewhere_else import Popen
===

Put this way, it is clear (to me) that somewhere_else
should be python24.

In other words, I'm asking for a python24 package that
contains all (or most) of the modules that are new to
Python 2.4.

I've looked around a bit, and it seems that this
formulation of the solution is new. I wonder if
anyone else has encountered this problem, or has
comments on my solution.

--
Jonathan

Mar 20 '07 #1
7 1851
On Mar 20, 10:33 am, Jonathan Fine <j...@pytex.org wrote:
Hello

My problem is that I want a Python 2.4 module on
a server that is running Python 2.3. I definitely
want to use the 2.4 module, and I don't want to
require the server to move to Python 2.4.

More exactly, I am using subprocess, which is
new in Python 2.4. What I am writing is something
like
===
from subprocess import Popen
===

This will fail in Python 2.3, in which case I
would like to write something like
===
try:
from subprocess import Popen
else ImportError:
from somewhere_else import Popen
===

Put this way, it is clear (to me) that somewhere_else
should be python24.

In other words, I'm asking for a python24 package that
contains all (or most) of the modules that are new to
Python 2.4.

I've looked around a bit, and it seems that this
formulation of the solution is new. I wonder if
anyone else has encountered this problem, or has
comments on my solution.

--
Jonathan
You might be able to use the "from future import SomeModule" syntax to
accomplish this, but I am not sure. Other than that, I would just
recommend using the os.popen calls that are native to 2.3

Mike

Mar 20 '07 #2
Jonathan Fine <jf***@pytex.or gwrote:
...
In other words, I'm asking for a python24 package that
contains all (or most) of the modules that are new to
Python 2.4.
For subprocess specifically, see
<http://www.lysator.liu .se/~astrand/popen5/. I don't think anybody's
ever packaged up ALL the new stuff as you require.
Alex
Mar 20 '07 #3
ky******@gmail. com wrote:
On Mar 20, 10:33 am, Jonathan Fine <j...@pytex.org wrote:
>>My problem is that I want a Python 2.4 module on
a server that is running Python 2.3. I definitely
want to use the 2.4 module, and I don't want to
require the server to move to Python 2.4.
You might be able to use the "from future import SomeModule" syntax to
accomplish this, but I am not sure. Other than that, I would just
recommend using the os.popen calls that are native to 2.3
I've already made my mind up. I want to use subprocess on
both 2.3 and 2.4. To do this, 2.3 sites have to have a copy
of the subprocess module.

My question (snipped) is how best to package this up.

best regards
Jonathan

Mar 20 '07 #4
Hi,
You can't import subproces from future, only syntactic and semantic
changes that will become standard feature in future python version can
be activated that way.

You can copy the subprocess module from python 2.4 somewhere where it
will be found from python 2.3. At least subporcess is importable after that:

--- snip ---
klix@vesuv6:~/tttcp -av /usr/local/lib/python2.4/subprocess.py .
»/usr/local/lib/python2.4/subprocess.py« -»./subprocess.py«
klix@vesuv6:~/tttpython2.3
Python 2.3.3 (#1, Jun 29 2004, 14:43:40)
[GCC 3.3 20030226 (prerelease) (SuSE Linux)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.
>>import subprocess
--- snip ---

HTH,
Gerald

ky******@gmail. com schrieb:
On Mar 20, 10:33 am, Jonathan Fine <j...@pytex.org wrote:
>>Hello

My problem is that I want a Python 2.4 module on
a server that is running Python 2.3. I definitely
want to use the 2.4 module, and I don't want to
require the server to move to Python 2.4.

More exactly, I am using subprocess, which is
new in Python 2.4. What I am writing is something
like
===
from subprocess import Popen
===

This will fail in Python 2.3, in which case I
would like to write something like
===
try:
from subprocess import Popen
else ImportError:
from somewhere_else import Popen
===

Put this way, it is clear (to me) that somewhere_else
should be python24.

In other words, I'm asking for a python24 package that
contains all (or most) of the modules that are new to
Python 2.4.

I've looked around a bit, and it seems that this
formulation of the solution is new. I wonder if
anyone else has encountered this problem, or has
comments on my solution.

--
Jonathan


You might be able to use the "from future import SomeModule" syntax to
accomplish this, but I am not sure. Other than that, I would just
recommend using the os.popen calls that are native to 2.3

Mike
Mar 20 '07 #5
Alex Martelli wrote:
Jonathan Fine <jf***@pytex.or gwrote:
...
>>In other words, I'm asking for a python24 package that
contains all (or most) of the modules that are new to
Python 2.4.


For subprocess specifically, see
<http://www.lysator.liu .se/~astrand/popen5/.
Thanks for the URL.
I don't think anybody's
ever packaged up ALL the new stuff as you require.
Actually, all I require (for now) is subprocess. So
I went and made a python24 module. I'll change this
if people think something else would be better. (It's
easy to ask for forgiveness than ask for permission.)

I can show you what I've done:
http://texd.cvs.sourceforge.net/texd/py/python24/
http://texd.cvs.sourceforge.net/texd....4&view=markup

My idea is that python24 should contain the Python 2.4
modules that those who are still on Python 2.3 might
want to use.

Similarly, python26 would be modules that are new
for Python 2.6 (which has not been released next).

I doubt that I'm the only one with this problem, and
this is my suggestion for making it easier to solve.

--
Jonathan
Mar 20 '07 #6
In article <1h************ **************@ mac.com>,
Alex Martelli <al***@mac.comw rote:
>
For subprocess specifically, see
<http://www.lysator.liu .se/~astrand/popen5/. I don't think anybody's
ever packaged up ALL the new stuff as you require.
Oh, good that web page came back. (When we were down to the wire on
_Python for Dummies_, it had been offline for more than a month, and I
had to decide whether to include it, and I did.)
--
Aahz (aa**@pythoncra ft.com) <* http://www.pythoncraft.com/

"Typing is cheap. Thinking is expensive." --Roy Smith
Mar 20 '07 #7
Gerald Klix wrote:
Hi,
You can't import subproces from future, only syntactic and semantic
changes that will become standard feature in future python version can
be activated that way.

You can copy the subprocess module from python 2.4 somewhere where it
will be found from python 2.3. At least subporcess is importable after
that:

--- snip ---
klix@vesuv6:~/tttcp -av /usr/local/lib/python2.4/subprocess.py .
»/usr/local/lib/python2.4/subprocess.py« -»./subprocess.py«
klix@vesuv6:~/tttpython2.3
Python 2.3.3 (#1, Jun 29 2004, 14:43:40)
[GCC 3.3 20030226 (prerelease) (SuSE Linux)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.
>>import subprocess
>>>
You're quite right about the use of __future__. I decided to
put subprocess in a package, so that my system can choose
which one to find, whether running Python 2.3 or 2.4.

(Well, in 2.3 there's no choice, but in 2.4 I don't want
the "just for 2.3" module to hide the real 2.4 module.)

The responses I've had indicate that my approach might
be a good idea, and might be useful to others. For me,
that's enough for now.

--
Jonathan

Mar 21 '07 #8

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

Similar topics

5
2189
by: A. B., Khalid | last post by:
For those how downloaded the new python, how big is it? I am speaking of the DLL on Windows. I am just curious; it would be interesting to compare the sizes of earlier versions with this alpha release. These are the python versions I know about: python21.dll, July, 26th, 2001, 693KB python23.dll, July, 29th, 2003, 953KB
1
3572
by: Martin Bless | last post by:
Now that I've got my extension building machine using the VC++ Toolkit 2003 up and running I'm keen on using Pyrex (Pyrex-0.9.3, Python-2.4.0). But the definition of the swig_sources() method seems to have changed. When I try to build the examples from Pyrex I get a TypeError: c:\Pyrex-0.9.3\Demos> python Setup.py build_ext --inplace
1
3869
by: Warren Postma | last post by:
It seems that WinCvs needs a python??.dll runtime but that when I install Python2.4 it doesn't include this dll. Python 2.3 does. What's the recommendation here? Warren
24
3709
by: Robin Becker | last post by:
Investigating a query about the python path I see that my win32 installation has c:/windows/system32/python24.zip (which is non existent) second on sys.path before the actual python24/lib etc etc. Firstly should python start up with non-existent entries on the path? Secondly is this entry be the default for some other kind of python...
3
1578
by: Robert | last post by:
updating a py2exe'd software I was impressed by python24.dll's footprint - double size of python23.dll Is there a version without/separate asianc codecs (which seem to mainly blow up python24.dll)? Or how to build one? Robert
1
1470
by: Robert | last post by:
Martin v. Löwis schrieb: > Robert wrote: > > Wouldn't it be an issue to think about if future win-python distributions > > should keep on including the asian codecs in the main-dll? > > Indeed, it would. As I said before: if somebody defines a clear, fair > policy which finds agreement in the community, I'm willing to change the > current...
10
1804
by: Bugs | last post by:
I believe I read in a relatively recent thread that the reason python24.dll is so large compared to previous releases is that all the language encodings are linked into the library? Are there any plans for future releases to split the encodings out so that, for example, if someone wanted to make a smaller executable using py2exe without all...
0
1263
by: magazine | last post by:
-----Original Message----- From: Steve Holden Sent: 2006Äê4ÔÂ4ÈÕ 20:00 To: DMagazine@163.com Cc: tim@pollenation.net Subject: Re: #286: Py_Initialize faliure if the python24.lib build with vc8 psf wrote:
0
1907
by: Steven Samuel Cole | last post by:
Hi Stephane, thanks for your reply! :-) I do not get any notification or warning or whatever from dpkg, all output I get when running # sudo dpkg -i python-<package name>_0.0.1-4927-1_all.deb is Selecting previously deselected package python-<package name>. (Reading database ... 15026 files and directories currently installed.)
0
7560
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7998
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7844
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6098
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5126
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1978
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1093
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.