fstools.py 文件源码

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

项目:zielen 作者: lostatc 项目源码 文件源码
def scan_tree(path: str):
    """Recursively scan a directory tree and yield an os.DirEntry object.

    Args:
        path: The path of the directory to scan.

    Yields:
        An os.DirEntry object for each file in the tree.
    """
    for entry in os.scandir(path):
        yield entry
        if entry.is_dir(follow_symlinks=False):
            yield from scan_tree(entry.path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号