PyDocs

Nav

Importing Modules

__import__

importlib

function (source)
  • __import__(name, globals=None, locals=None, fromlist=(), level=0)
Import a module.

The 'globals' argument is used to infer where the import is occurring from
to handle relative imports. The 'locals' argument is ignored. The
'fromlist' argument specifies what should exist as attributes on the module
being imported (e.g. ``from module import <fromlist>``).  The 'level'
argument represents the package location to import from in a relative
import (e.g. ``from ..pkg import mod`` would have a 'level' of 2).
0 Examples
No examples for importlib/__import__.
See Also
No see-alsos for importlib/__import__
0 Notes
No notes for __import__