import os def create_str_to_txt(self,date,str_data): """ 创建txt,并且写入 """ path_file_name = './report/action_{}.txt'.format(date) if not os.path.exists(path_file_name): with open(path_file_name, "w") as f: print(f) wit
#批量创建txt文件import sys,osa=open("demo.txt")n=0aList=[]for line in a.readlines(): aList.append(str(line.strip('\n')))print aListfor i in aList: os.system('@echo > %s.txt'%i)
txtPath=os.path.join(vocDir,"eval.txt") with open(txtPath,"w") as f: f.writelines("allGroundBoxNum:{}\n".format(groundBoxNum)) f.writelines("allDetectedBoxNum:{}\n".format(detectedBoxNum)) f.writelines("allDete
import flash.filesystem.*; var file:File=new File(File.applicationDirectory.nativePath + '/HelloWorld.txt'); var stream:FileStream = new FileStream() stream.open(file, FileMode.WRITE); var str:String = "Congratulations on AIR Save Path"; stream.