CSV Dictionary

Tim Chase python.list at tim.thechases.com
Mon Dec 29 12:06:44 EST 2014


On 2014-12-29 16:37, JC wrote:
> On Mon, 29 Dec 2014 10:32:03 -0600, Skip Montanaro wrote:
> 
> > On Mon, Dec 29, 2014 at 10:11 AM, JC <chalao.adda at gmail.com>
> > wrote:
> >> Do I have to open the file again to get 'rdr' work again?
> > 
> > Yes, but if you want the number of records, just operate on the
> > rows list, e.g. len(rows).
> 
> Yes, I did that. But if I need to use 'rdr' again, I have to open
> it again, right? Is there any ways to get 'rdr' point to first
> record again?

Yeah-but.  What do you need rdr for again?  You've already sucked all
the information out of it into your data-structure.  If you needed
other information, you should pull it out the first time you iterate
through the DictReader.

-tkc





More information about the Python-list mailing list