Import mechanism to support multiple Python versions

Thomas Heller theller at python.net
Fri Mar 18 12:31:28 EST 2005


Nicolas Fleury <nid_oizo at yahoo.com_remove_the_> writes:

> I have also third party packages.  Is it possible to make a package
> point to another folder?  For example:
>
> psyco23/...
> psyco24/...
> psyco/__init__.py  => points to psyco23 or psyco24 depending on Python
> version used.

You may manipulate the package path in the __init__.py file.
pkgutil may also be useful.

Thomas



More information about the Python-list mailing list