下面的代码允许我实现这个结果,但是
- 我希望文件名和类型像旁边的图片一样,只包含一个。
- 有没有办法解决这个问题?
if __name__ == '__main__': #start of program
master = Tk()
newDirRH = "C:/VSMPlots"
FileName = "J12312312"
TypeName = "1234"
Field = [1,2,3,4,5,6,7,8,9,10]
Court = [5,4,1,2,3,4,5,1,2,3]
newfile = newDirRH + "/Try1.csv"
with open(newfile, "wb") as csvfile:
writer = csv.writer(csvfile)
writer.writerow(["FileName", "TypeName", "field", "court"])
for field, court in zip(Field, Court):
writer.writerow([FileName, TypeName, field, court])
print "Done"