Re: csv module and None values

2009-08-29 Thread JKPeck
On Aug 25, 8:49 am, Peter Otten <__pete...@web.de> wrote: > JKPeck wrote: > > On Aug 24, 10:43 pm, John Yeung wrote: > >> On Aug 24, 5:00 pm, Peter Otten <__pete...@web.de> wrote: > > >> > If I understand you correctly the csv.writer already does > >> > what you want: > > >> > >>> w.writerow([1,No

Re: csv module and None values

2009-08-25 Thread Peter Otten
JKPeck wrote: > On Aug 24, 10:43 pm, John Yeung wrote: >> On Aug 24, 5:00 pm, Peter Otten <__pete...@web.de> wrote: >> >> > If I understand you correctly the csv.writer already does >> > what you want: >> >> > >>> w.writerow([1,None,2]) >> > 1,,2 >> >> > just sequential commas, but that is the sp

Re: csv module and None values

2009-08-25 Thread JKPeck
On Aug 24, 10:43 pm, John Yeung wrote: > On Aug 24, 5:00 pm, Peter Otten <__pete...@web.de> wrote: > > > If I understand you correctly the csv.writer already does > > what you want: > > > >>> w.writerow([1,None,2]) > > 1,,2 > > > just sequential commas, but that is the special treatment. > > Witho

Re: csv module and None values

2009-08-24 Thread John Yeung
On Aug 24, 5:00 pm, Peter Otten <__pete...@web.de> wrote: > If I understand you correctly the csv.writer already does > what you want: > > >>> w.writerow([1,None,2]) > 1,,2 > > just sequential commas, but that is the special treatment. > Without it the None value would be converted to a string > an

Re: csv module and None values

2009-08-24 Thread John Yeung
On Aug 24, 1:30 pm, JKPeck wrote: > 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 say

Re: csv module and None values

2009-08-24 Thread Peter Otten
JKPeck wrote: > 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

Re: csv module and None values

2009-08-24 Thread JKPeck
On Aug 24, 11:30 am, JKPeck wrote: > 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