結果顯示是這樣的。我試過關於方法的問題,無論它看起來好像不能向上移動。謝謝你提前如何從新的新行寫入csv不是 n
- 反正有法院陣列向上?
- 或者我應該刪除該行直接全的
if __name__ == '__main__': #start of program
master = Tk()
newDirRH = "C:/VSMPlots"
FileName = "J123"
TypeName = "1234"
Field = [1,2,3,4,5,6,7,8,9,10]
Court = [5,4,1,2,3,4,5,1,2,3]
Field = "\n,,".join(str(x) for x in Field) # to leave a line in each Field array
Court = "\n,,,".join(str(y1) for y1 in Court) # to leave a line in each Court array
stringText = "Name, Type, Field, Court\n" + str(FileName) + ',' + str(TypeName) + ',' + Field + '\n,,,' + Court
newfile = newDirRH + "/Try.csv"
text_file = open(newfile, "w")
x = stringText
text_file.write(x)
text_file.close()
print "Done"
可能重複[?如何加入列表逐元素在Python(http://stackoverflow.com/questions/1885300/如何加入列表元素明智的蟒蛇) – tripleee
你的問題不是很清楚措辭,但似乎很清楚,你應該實際上正在尋找如何加入兩個列表。 – tripleee
嗨,我知道zip獲得2數組togehter但問題是它不能寫入CSV文件。我不想要如何加入2個列表 –