3ds-to-cia.py 文件源码

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

项目:3ds-to-cia 作者: drizzt 项目源码 文件源码
def which(cmd):
    path = os.environ.get("PATH", os.defpath)
    if not path:
        return None
    path = [get_tools_path()] + path.split(os.pathsep) + ["."]
    if sys.platform == "win32":
        pathext = os.environ.get("PATHEXT", "").split(os.pathsep)
        files = [cmd + ext for ext in pathext]
    else:
        files = [cmd]

    seen = set()
    for dir in path:
    normdir = os.path.normcase(dir)
    if normdir not in seen:
        seen.add(normdir)
        for thefile in files:
        name = os.path.join(dir, thefile)
        if os.path.exists(name):
            return name
    return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号