mlpy.auxiliary.io.import_module_from_path

mlpy.auxiliary.io.import_module_from_path(full_path, global_name)[source]

Import a module from a file path and return the module object.

Allows one to import from anywhere, something __import__ does not do. The module is added to sys.modules as global_name.

Parameters:

full_path : str

The absolute path to the module .py file

global_name : str

The name assigned to the module in sys.modules. To avoid confusion, the global_name should be the same as the variable to which you’re assigning the returned module.

Examples

>>> from mlpy.auxiliary.io import import_module_from_path

Note

Project: Code from Trigger.
Copyright (c) 2006-2012, AOL Inc.
License: BSD