This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paullongnet
Recipients paullongnet
Date 2017-11-22.18:36:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511375791.45.0.213398074469.issue32116@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2017-11-22 18:36:31paullongnetsetrecipients: + paullongnet
2017-11-22 18:36:31paullongnetsetmessageid: <1511375791.45.0.213398074469.issue32116@psf.upfronthosting.co.za>
2017-11-22 18:36:31paullongnetlinkissue32116 messages
2017-11-22 18:36:31paullongnetcreate