module.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:USTC-Software-2017 作者: igemsoftware2017 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号