importing modules

Alex Hall mehgcap at gmail.com
Fri May 7 07:02:41 EDT 2010


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.lamboj at 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)
mehgcap at gmail.com; http://www.facebook.com/mehgcap



More information about the Python-list mailing list