67def SaveResultTxt(runlist, header):
68
69 f = open( '%s/QueryResult.txt' % QC.datapath, 'w' )
70 print ("data keys:", ', '.join([h.ResultKey for h in header]), file=f)
71 print ('number of runs: %i' % len(runlist), file=f)
72
73
74 for r in runlist:
75 line = []
76 if Run.showrunnr:
77 line += ["%i" % r.runNr, "", "%i" % r.lastlb]
78 if Run.showtime:
79 line += ["%s" % r.timestr('seconds')]
80 if Run.showduration:
81 line += ["%s" % r.durationstr()]
82 for k in Run.ShowOrder:
83 line += [r.data[k.ResultKey]]
84 for head,item in zip(header,line):
85 if isinstance(item,tuple):
86 item = '|'.join([str(x) for x in item])
87 print ('%40s: %s' % (head.ResultKey, item), file=f)
88 print ('\n', file=f)
89 f.close()
90
91
92
93