import os
import glob
localDir = ‘F:/test/test1/‘
file_test = open(localDir + ‘file_test.txt‘,‘w‘)
os.chdir(localDir)
for file_name in glob.glob(‘*.jpg‘):
#print (file_name)
file_test.write( ‘test1/‘ + str(file_name) + ‘\n‘)
file_test.close()
时间: 2024-10-22 08:48:23