Re: csv.DictWriter.write_header()

2009-08-14 Thread Chris Withers
Alan G Isaac wrote: On 8/13/2009 7:58 AM John Machin apparently wrote: Duck typing: ask a silly question, get a silly answer. Maybe if you learned to be a more generous reader, fewer questions would look "silly" to you. If you take a look at the crap that John very patiently wades through on

Re: csv.DictWriter.write_header()

2009-08-14 Thread Alan G Isaac
> On Aug 13, 1:15 pm, Alan G Isaac wrote: >> I do not understand the reason for your silly, sarcastic response. On 8/13/2009 7:58 AM John Machin apparently wrote: > Duck typing: ask a silly question, get a silly answer. Maybe if you learned to be a more generous reader, fewer questions would lo

Re: csv.DictWriter.write_header()

2009-08-13 Thread Chris Rebert
On Wed, Aug 12, 2009 at 4:45 PM, Alan G Isaac wrote: > Given a csv.DictWriter instance `dw` > I think it would be nice to be able to > say dw.write_header() > instead of > dw.writer.writerow(dw.fieldnames) > > Good idea? Maybe. You could file a bug: http://bugs.python.org/ Cheers, Chris -- http:

Re: csv.DictWriter.write_header()

2009-08-13 Thread John Machin
dnames) > > >> Good idea? > > On 8/12/2009 10:24 PM John Machin apparently wrote: > > > Yes, it's a brilliant idea. All you have to do is insert the following > > lines in your code after importing csv: > > > csv.DictWriter.write_header = ( > >

Re: csv.DictWriter.write_header()

2009-08-12 Thread Alan G Isaac
hin apparently wrote: > Yes, it's a brilliant idea. All you have to do is insert the following > lines in your code after importing csv: > > csv.DictWriter.write_header = ( > lambda dw: dw.writer.writerow(dw.fieldnames) > ) I do not understand the reason for your silly

Re: csv.DictWriter.write_header()

2009-08-12 Thread John Machin
he following lines in your code after importing csv: csv.DictWriter.write_header = ( lambda dw: dw.writer.writerow(dw.fieldnames) ) -- http://mail.python.org/mailman/listinfo/python-list

csv.DictWriter.write_header()

2009-08-12 Thread Alan G Isaac
Given a csv.DictWriter instance `dw` I think it would be nice to be able to say dw.write_header() instead of dw.writer.writerow(dw.fieldnames) Good idea? Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list