importing modules

  • Follow


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
0
Reply Richard 5/7/2010 10:55:48 AM

Richard Lamboj <richard.lamboj@bilcom.at> schrieb:
>
> 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

Hi Richi,

starting with 2.5 Python allows relative imports, e.g. import ..blah

Andi
0
Reply Andi 5/7/2010 11:19:03 AM


1 Replies
131 Views

(page loaded in 0.045 seconds)

Similiar Articles:













7/14/2012 6:03:53 PM


Reply: