util.py 文件源码

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

项目:batch-shipyard 作者: Azure 项目源码 文件源码
def scantree(path):
    # type: (str) -> os.DirEntry
    """Recursively scan a directory tree
    :param str path: path to scan
    :rtype: DirEntry
    :return: DirEntry via generator
    """
    for entry in scandir(path):
        if entry.is_dir(follow_symlinks=True):
            # due to python2 compat, cannot use yield from here
            for t in scantree(entry.path):
                yield t
        else:
            yield entry
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号