pkgutil
pkgutil — Package extension utility
New in version 2.3.
Source code: Lib/pkgutil.py
This module provides utilities for the import system, in particular package support.
-
pkgutil.extend_path(path, name)
-
Extend the search path for the modules which comprise a package. Intended use is to place the following code in a package’s
__init__.py
:from pkgutil import extend_path __path__ = extend_path(__path__, __name__)
This will add to the package’s
__path__
all subdirectories of directories onsys.path
named after the package. T