您的位置:首页 > 房产 > 家装 > 北京工程建设交易信息网官网_微信app下载安装到手机上_p2p万能搜索种子_网页搭建

北京工程建设交易信息网官网_微信app下载安装到手机上_p2p万能搜索种子_网页搭建

2025/4/19 16:30:10 来源:https://blog.csdn.net/weixin_38523904/article/details/147315775  浏览:    关键词:北京工程建设交易信息网官网_微信app下载安装到手机上_p2p万能搜索种子_网页搭建
北京工程建设交易信息网官网_微信app下载安装到手机上_p2p万能搜索种子_网页搭建
import osdef read_files_in_directory(root_dir):# 遍历根目录下的所有文件和目录for year_dir in os.listdir(root_dir):year_path = os.path.join(root_dir, year_dir)if os.path.isdir(year_path):  # 确保是目录for month_dir in os.listdir(year_path):# if month_dir in ["06", "07"]:month_path = os.path.join(year_path, month_dir)if os.path.isdir(month_path):  # 确保是目录for filename in os.listdir(month_path):file_path = os.path.join(month_path, filename)if os.path.isfile(file_path):  # 确保是文件print(file_path)# with open(file_path, 'r', encoding='utf-8') as file:#     content = file.read()#     print(f"Reading file: {file_path}")#     print(content)  # 或者处理内容,比如分析、存储等# # 根据需要处理文件内容,例如写入另一个文件或数据库等# 调用函数,传入根目录路径
read_files_in_directory(r".\target")

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com