1. 遍历文件夹中的所有文件
import glob
import os
path='C:/Users/EDZ/Desktop/工作/2021.08.19/'
for infile in glob.glob(os.path.join(path, '*.csv')):
print(infile)
2. 删除文件夹中所有.csv文件
import os
import glob
path='C:/Users/EDZ/Desktop/工作/2021.08.19/'
for infile in glob.glob(os.path.join(path, '*.csv')):
os.remove(infile)
print(infile)