Python: import the containing package

Posted by guy on Stack Overflow See other posts from Stack Overflow or by guy
Published on 2009-01-12T18:38:15Z Indexed on 2010/04/26 2:03 UTC
Read the original article Hit count: 265

Filed under:
|
|
|

In a module residing inside a package, i have the need to use a function defined within the __init__.py of that package. how can i import the package within the module that resides within the package, so i can use that function?

Importing __init__ inside the module will not import the package, but instead a module named __init__, leading to two copies of things with different names...

Is there a pythonic way to do this?

© Stack Overflow or respective owner

Related posts about python

Related posts about module