I\'m working on a documentation (personal) for nested matplotlib (MPL) library, which differs from MPL own provided, by interested submodule packages. I\'m writing Python sc
importlib.import_module is what you are looking for. It returns the imported module. (Only available for Python >= 2.7 or 3.x):
import importlib mymodule = importlib.import_module('matplotlib.text')
You can thereafter access anything in the module as mymodule.myclass, etc.
mymodule.myclass