append text in csv file python code example
Example 1: append to csv python
with open('document.csv','a') as fd:
fd.write(myCsvRow)
Example 2: how to append data to csv file in python without replacing the already present text
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()