Python and writing a CSV file

Skip Montanaro skip at pobox.com
Sun Jan 25 15:29:41 EST 2004


    Norm> writer = csv.writer(file('csv_test.CSV', 'w'))
    ...
    Norm> So the question is, where does the extra crlf in the csv file come
    Norm> from? And how do I get rid of it?

Try opening the CSV file in binary mode:

    writer = csv.writer(file('csv_test.CSV', 'wb'))

Skip




More information about the Python-list mailing list