Re: csv.DictWriter.write_header()

2009-08-14 Thread Alan G Isaac
On Aug 13, 1:15 pm, Alan G Isaac alan.is...@gmail.com 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

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-13 Thread John Machin
/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 = (     lambda dw: dw.writer.writerow(dw.fieldnames)     ) I do not understand the reason for your

Re: csv.DictWriter.write_header()

2009-08-13 Thread Chris Rebert
On Wed, Aug 12, 2009 at 4:45 PM, Alan G Isaacalan.is...@gmail.com 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,

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

Re: csv.DictWriter.write_header()

2009-08-12 Thread John Machin
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

Re: csv.DictWriter.write_header()

2009-08-12 Thread Alan G Isaac
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, sarcastic response. I already showed you how to achieve the result