Answers for "how to append data to csv file in python without replacing the already present text"

0

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()
Posted by: Guest on March-02-2021

Code answers related to "how to append data to csv file in python without replacing the already present text"

Python Answers by Framework

Browse Popular Code Answers by Language