ch13_r06.py 文件源码

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

项目:Modern-Python-Cookbook 作者: PacktPublishing 项目源码 文件源码
def process_all_files(result_file, file_names):
    for source_path in (Path(n) for n in file_names):
        detail_log.info("read {}".format(source_path))
        with source_path.open() as source_file:
            game_iter = yaml.load_all(source_file)
            statistics = gather_stats(game_iter)
            result_file.write(
                yaml.dump(dict(statistics), explicit_start=True)
            )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号