我是靠谱客的博主 大方路人,这篇文章主要介绍python 读取指定目录下的所有文件包括子目录下的,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
import os def file_name(file_dir): for root, dirs, files in os.walk(file_dir): # print('root_dir:', root) # print('sub_dirs:', dirs) print('files:', files) file_name('C:\work\projectTEST\2020_NEW_PLAN\')

https://www.cnblogs.com/bigtreei/p/9316369.html

最后

以上就是大方路人最近收集整理的关于python 读取指定目录下的所有文件包括子目录下的的全部内容,更多相关python内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(75)

评论列表共有 0 条评论

立即
投稿
返回
顶部