pysys.utils.loader module

pysys.utils.loader.import_module(name, path, reload=False)[source]

Import a named module, searching within a list of paths.

Supports loading of hierarchical modules from a list of paths, returning a reference to the loaded module. Reloading of the module can be requested should the module already exist in sys.modules. Note that in a module named X.Y.Z, should reload be set to True only the tail module, X.Y.Z, will be reloaded on import; the intervening modules, X and X.Y, will not be reloaded.

Parameters:
  • name – The module name
  • path – A list of paths to search for the module
  • reload – A boolean indicating if the module should be reloaded if already in sys.modules