N00b question: matching stuff with variables.

Tim Golden mail at timgolden.me.uk
Tue Jun 29 10:41:34 EDT 2010


On 29/06/2010 15:14, Stephen Hansen wrote:
> True: but I've personally never seent he point of the csv module unless
> we're talking about a more complicated csv format, such as one with
> quoting in fields. I don't know if that's what the OP is working with,
> but good point: csv might be a good approach if this is more complicated
> format then just a line with a couple commas.

The most common reason is that it caters for all the nastiness of embedded
commas, quotes etc. which you'd otherwise have to end up reinventing. If
you know your data's just a string of numbers, then just use s.split (",").

TJG



More information about the Python-list mailing list