help I'm getting delimited

A

aka

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top