14 lines
281 B
Python
14 lines
281 B
Python
import sys
|
|
import importlib.util as ilu
|
|
|
|
|
|
def load_module(module_name, file_path):
|
|
spec = ilu.spec_from_file_location(module_name, file_path)
|
|
module = ilu.module_from_spec(spec)
|
|
sys.modules[module_name] = module
|
|
spec.loader.exec_module(module)
|
|
return module
|
|
|
|
|
|
|