Request for a change in the csv module.

Paulo da Silva psdasilvaX at esotericaX.ptX
Mon Mar 12 21:00:53 EDT 2007


attn.steven.kuo at gmail.com escreveu:
> On Mar 12, 4:26 pm, Paulo da Silva <psdasil... at esotericaX.ptX> wrote:
...

> 
> locale.setlocale(locale.LC_NUMERIC, 'pt_BR.ISO8859-1')
> csv_writer = csv.writer(open("foo.csv","w"), dialect='excel')
> rows = (('testing', 1.23), ('testing', 2.34))
> formatted_rows = ((string, locale.format('%g', number)) for
> (string,number) in rows)
> csv_writer.writerows(formatted_rows)


That works but it is a pain to use.
May be I'll sublass csv or even I'll write one myself.
It would be much better to be able to specify an additional
variabel to the Dialect class and change csv.

Thanks
Paulo



More information about the Python-list mailing list