Write newline to csv in Python
change 'w' to 'a'
with open('outfile.csv','a')
with open('outfile.csv', 'w', newline='') as f:
f.writerow(...)
Alternatively:
f = csv.writer('outfile.csv', lineterminator='\n')
change 'w' to 'a'
with open('outfile.csv','a')
with open('outfile.csv', 'w', newline='') as f:
f.writerow(...)
Alternatively:
f = csv.writer('outfile.csv', lineterminator='\n')