help I'm getting delimited

aka alexoplocatie at gmail.com
Tue Dec 16 17:26:57 CET 2008


Hi, I'm going nuts over the csv.reader and UnicodeReader class.
Somehow I can't get this method working which is supposed to read a
csv file which name is inputted but here now hardcoded. What I need
for now is that the string version of the list is put out for control.
Later on I will only need to read the first column (id) of the csv
file to be able to fill in a session var with a list of all ids.
inp = c:/temp/test.csv
roles = []
try:
fp = open(inp, 'rb')
reader = csv.reader(fp)
for r in reader:
    rollen.append(r)
except:
    msg = "Er is iets mis met de UnicodeReader"

return dict(file=in,roles=str(roles))
Any help greatly appreciated!
Cheers



More information about the Python-list mailing list