-2
我有一個文件已經寫(「file_wrote」)的例子:寫在追加模式已經寫入文件
1, 1, 1, 1, 1, 1
2, 2, 2, 2, 2, 2
3, 3, 3, 3, 3, 3
當我希望寫的一行:
line = ["a","a","a","a","a","a"]
newline = " ".join([str(e) for e in line]) + "\n"
with open("file_wrote", 'a') as file_out:
file_out.write(newline)
我得到了這樣的問題:
1, 1, 1, 1, 1, 1
2, 2, 2, 2, 2, 2
3, 3, 3, 3, 3, 3, a, a, a, a, a, a