local.py 文件源码

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

项目:S4 作者: MichaelAquilina 项目源码 文件源码
def traverse(path, ignore_files=None):
    if not os.path.exists(path):
        return

    if ignore_files is None:
        ignore_files = []

    for item in scandir(path):
        if any(fnmatch.fnmatch(item.name, pattern) for pattern in ignore_files):
            logger.debug('Ignoring %s', item)
            continue

        if item.is_dir():
            for result in traverse(item.path, ignore_files):
                yield os.path.join(item.name, result)
        else:
            yield item.name
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号