I have a main folder. Inside that I have a "modes" package (subfolder holding __init__.py) as well as a "misc" package. When modes has to import helpers.py from misc, I use this: from .misc import helpers The period makes Python look up one level for misc, then go into it to find helpers.
On 5/7/10, Richard Lamboj <richard.lam...@bilcom.at> wrote: > > Hello, > > I have a question about importing python modules. > > I have modul package, with submodules. So how can a submodul access a modul > that is on level upper? > > Is there something like "import ../../blah"? I don't mean something like > this: "import bla.blub.moep" > > Kind Regards, > > Richi > -- > http://mail.python.org/mailman/listinfo/python-list > -- Have a great day, Alex (msg sent from GMail website) mehg...@gmail.com; http://www.facebook.com/mehgcap -- http://mail.python.org/mailman/listinfo/python-list