New submission from Paul Long <p...@paullong.net>:

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)

----------
components: Library (Lib)
messages: 306746
nosy: paullongnet
priority: normal
severity: normal
status: open
title: CSV import and export simplified
type: enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32116>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to