[Tutor] A CSV field is a list of integers - how to read it as such?

DoanVietTrungAtGmail doanviettrung at gmail.com
Thu Mar 7 03:05:52 CET 2013


> Once a csv file has been read by a csv reader (such as DictReader), it's
> no longer a csv file.


That was an "Aha!" moment for me. The file is on disk, each row of it is in
memory as a list or dict, and it's the list or dict that matters. It's so
obvious now. Thanks Dave.

>

a namedtuple is probably exactly what you want.


I read this as meaning that while tuples themselves are immutable, to
effectively modify it I simply delete it and replace it with a new tuple
with new values. Another 'Aha!'

Trung
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130307/7a4cd395/attachment.html>


More information about the Tutor mailing list