Message306746
It would be helpful if the CSV module included standard functions that simplify the import of CSV files to a list and the export of CSV files to a list. Here's an example of what they could be:
def csv2list(file_name):
list_name=[]
with open(file_name) as csvfile:
readerfile = reader(csvfile)
for row in readerfile:
list_name.append(row)
return list_name
def list2csv(list_name,file_name):
with open(file_name, 'w', newline='') as csvfile:
writerfile = csv.writer(csvfile)
writerfile.writerows(list_name) |
|
Date |
User |
Action |
Args |
2017-11-22 18:36:31 | paullongnet | set | recipients:
+ paullongnet |
2017-11-22 18:36:31 | paullongnet | set | messageid: <1511375791.45.0.213398074469.issue32116@psf.upfronthosting.co.za> |
2017-11-22 18:36:31 | paullongnet | link | issue32116 messages |
2017-11-22 18:36:31 | paullongnet | create | |
|