Python and writing a CSV file

Skip Montanaro skip at pobox.com
Sun Jan 25 21:29:41 CET 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