importing packages from a zip file

Peter Tillotson none at no.chance
Wed Jun 29 19:59:06 CEST 2005

Hi all,

I was wondering if this is possible. In python v2.3 the import systems
was extended via PEP302 to cope with packages. *.py files in a directory
hierarchy can be imported as modules each level in the directory
hierarchy needs to contain at least an empty file.

eg. With the file system


I can import myModule as follows

import base.branch1.myModule

At the same time its possible to store modules in a flat zip-file and
import modules with the following.

from import

but is there a way to do both at the same time? eg.

from import base.branch1.myModule

I'm interested in this in the development of mobile code for some Grid
applications :-)

thanks in advance


More information about the Python-list mailing list