[Tutor] Read a random record in dictionary object from csv module reader?

xbmuncher xboxmuncher at gmail.com
Mon Oct 6 21:32:36 CEST 2008


import csv
reader = csv.DictReader(open("test_csv.csv", "r"))

reader is not an actual dictionary from my understanding.. so I don't know
how to access properties like the 'total items' in the dictionary
I want to be able to extract a random dictionary entry from the csv file,
how can I do this by using the csv reader module? If I can't, then show me a
better way to do it then..


-thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20081006/8505ba04/attachment.htm>


More information about the Tutor mailing list