def module_from_file_location(filename):
"""
Reference: https://stackoverflow.com/questions/67631/
Load and return a module object with the given file name.
"""
spec = importlib.util.spec_from_file_location('__tmp__', filename)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module
评论列表
文章目录