Wanted: a python24 package for Python 2.3

kyosohma at gmail.com kyosohma at gmail.com
Tue Mar 20 12:04:41 EDT 2007


On Mar 20, 10:33 am, Jonathan Fine <j... at 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




More information about the Python-list mailing list