python 创建、写入文件
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()