Package pysys :: Package utils :: Module loader
[frames] | no frames]

Module loader

source code

Functions
 
import_module(name, path, reload=False)
Import a named module, searching within a list of paths.
source code
Variables
  __package__ = 'pysys.utils'
Function Details

import_module(name, path, reload=False)

source code 

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