pkgutil.get_loader()

pkgutil.get_loader(module_or_name)

Get a PEP 302 “loader” object for module_or_name.

If the module or package is accessible via the normal import mechanism, a wrapper around the relevant part of that machinery is returned. Returns None if the module cannot be found or imported. If the named module is not already imported, its containing package (if any) is imported, in order to establish the package __path__.

Changed in version 3.3: Updated to be based directly on importlib rather than relying on the package internal PEP 302 import emulation.

Changed in version 3.4: Updated to be based on PEP 451

doc_python
2016-10-07 17:40:44
Comments
Leave a Comment

Please login to continue.