, 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.


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.


>>> from import import_module_from_path


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