On Aug 13, 6:45 am, Alan G Isaac <[email protected]> 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?
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)
)
--
http://mail.python.org/mailman/listinfo/python-list
