import os import csv l=[] for filename in os.listdir(r'D:\桌面文件\test'): l.append(filename) f=open("text.csv","w") for line in l: f.write(line+'\n') f.close()
import os import csv l=[] for filename in os.listdir(r'D:\桌面文件\test'): l.append(filename) f=open("text.csv","w") for line in l: f.write(line+'\n') f.close()