📜  如何在 python 中将数据附加到 csv 文件而不替换已经存在的文本 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:11.919000             🧑  作者: Mango

代码示例1
import csv

row =['Eric', '60']

with open('people.csv','a') as csvFile:   #a to append to existing csv file
    writer = csv.writer(csvFile)
    csvFile.write("\n")    #write your data to new line
    writer.writerow(row)
csvFile.close()