31.2.importlib — Convenience wrappers for__import__()¶
New in version 2.7.
This module is a minor subset of what is available in the more full-featuredpackage of the same name from Python 3.1 that provides a completeimplementation ofimport. What is here has been provided tohelp ease in transitioning from 2.7 to 3.1.
importlib.import_module(name,package=None)¶Import a module. Thename argument specifies what module toimport in absolute or relative terms(e.g. either
pkg.modor..mod). If the name isspecified in relative terms, then thepackage argument must bespecified to the package which is to act as the anchor for resolving thepackage name (e.g.import_module('..mod','pkg.subpkg')will importpkg.mod). The specified module will be inserted intosys.modulesand returned.
