writerows to existing csv python

Solutions on MaxInterview for writerows to existing csv python by the best coders in the world

showing results for - "writerows to existing csv python"
Simona
16 Jan 2016
1import sys 
2import os
3import csv
4
5listOfLines= [['name@domain.com', 'name@domain.com', 'name@domain.com', 'name@domain.com', 'name@domain.com', 'name@domain.com']]
6
7def write_to_csv(list_of_emails):
8   with open('emails.csv', 'w', newline='') as csvfile:
9       writer = csv.writer(csvfile, delimiter = ',')
10       writer.writerows(list_of_emails)
11
12write_to_csv(listOfLines)
13