Python 批量处理特定格式文件
生活随笔
收集整理的這篇文章主要介紹了
Python 批量处理特定格式文件
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1 #批量對(duì)文件夾下的'.mat'進(jìn)行處理
2
3 def file_name(file_dir,suff):
4 L=[]
5 for root, dirs, files in os.walk(file_dir):
6 for file in files:
7 if os.path.splitext(file)[1] == suff:
8 L.append(os.path.join(root, file))
9 return L
10
11 #調(diào)用
12 file_dir='D:\sa'
13 suff='.mat'
14 L=[]
15 L=file_name(file_dir,suff)
?
轉(zhuǎn)載于:https://www.cnblogs.com/Ann21/p/9487834.html
總結(jié)
以上是生活随笔為你收集整理的Python 批量处理特定格式文件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Spring mvc中自定义拦截器
- 下一篇: Centos 开机后,登录时无法输入密码