run.py 文件源码

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

项目:pheweb 作者: statgen 项目源码 文件源码
def attempt_open(url):
    import os
    import webbrowser
    if 'DISPLAY' not in os.environ:
        print('The DISPLAY variable is not set, so not attempting to open a web browser\n')
        return False
    for name in 'windows-default chrome chromium mozilla firefox opera safari'.split():
        # LATER: prepend `macosx` to this list when <http://bugs.python.org/issue30392> is fixed.
        try:
            b = webbrowser.get(name)
        except:
            pass
        else:
            if b.open(url):
                return True
    return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号