import os
import os.path
rootdir = "E:\Dissertation\论文\飞沫论文"
file_object = open('train_list.txt','w')
for parent,dirnames,filenames in os.walk(rootdir):
for filename in filenames:
print(filename)
file_object.write(filename+ '\n'+'\n')
file_object.close()
网友评论