csv module and None values

JKPeck jkpeck at gmail.com
Mon Aug 24 19:30:23 CEST 2009

I'm trying to get the csv module (Python 2.6) to write data records
like Excel.  The excel dialect isn't doing it.  The problem is in
writing None values.  I want them to result in just sequential commas
- ,, but csv treats None specially, as the doc says,

"To make it as easy as possible to interface with modules which
implement the DB API, the value None is written as the empty string."

I need strings to be quoted but not None values.  Is there any way to
get around this special None treatment?

Jon Peck

More information about the Python-list mailing list