In one of my Python packages, the file __init__.pycontains a statement
__init__.py
from . import XXXX
What does "." Mean mean here? I got this technique by looking at another package, but I don't understand what that means.
Thank!
This is a relative import .
Its relative imports. From: http://docs.python.org/py3k/reference/simple_stmts.html#the-import-statement
. . , ., , . . - .. , from . import mod pkg, pkg.mod. ..subpkg2 import mod pkg.subpkg1 pkg.subpkg2.mod. PEP 328.
. . , .
, , . . - .. , from . import mod pkg, pkg.mod. ..subpkg2 import mod pkg.subpkg1 pkg.subpkg2.mod. PEP 328.
from . import mod
..subpkg2 import mod