main.py 文件源码

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

项目:MTTT 作者: roxana-lafuente 项目源码 文件源码
def install_and_import(package):
    """@brief     Imports modules and installs them if they are not."""
    import importlib
    try:
        importlib.import_module(package)
    except ImportError:
        try:
            import pip
        except ImportError:
            print "no pip"
            os.system('python get_pip.py')
        finally:
            import pip
        pip.main(['install', package])
    finally:
        globals()[package] = importlib.import_module(package)


# these other ones I a am not so sure of. Thus the install function.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号