easy_install.py 文件源码

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

项目:Flask_Blog 作者: sugarguo 项目源码 文件源码
def _adjust_header(type_, orig_header):
        """
        Make sure 'pythonw' is used for gui and and 'python' is used for
        console (regardless of what sys.executable is).
        """
        pattern = 'pythonw.exe'
        repl = 'python.exe'
        if type_ == 'gui':
            pattern, repl = repl, pattern
        pattern_ob = re.compile(re.escape(pattern), re.IGNORECASE)
        new_header = pattern_ob.sub(string=orig_header, repl=repl)
        clean_header = new_header[2:-1].strip('"')
        if sys.platform == 'win32' and not os.path.exists(clean_header):
            # the adjusted version doesn't exist, so return the original
            return orig_header
        return new_header
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号