help I'm getting delimited

Discussion in 'Python' started by aka, Dec 16, 2008.

  1. aka

    aka Guest

    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
     
    aka, Dec 16, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RyanL
    Replies:
    6
    Views:
    726
    Paul McGuire
    Aug 28, 2007
  2. Paul Watson

    Re: help I'm getting delimited

    Paul Watson, Dec 16, 2008, in forum: Python
    Replies:
    14
    Views:
    549
  3. rep_movsd
    Replies:
    2
    Views:
    276
    rep_movsd
    Aug 17, 2011
  4. Miki Tebeka
    Replies:
    0
    Views:
    177
    Miki Tebeka
    Dec 5, 2012
  5. Ian Kelly
    Replies:
    0
    Views:
    166
    Ian Kelly
    Dec 5, 2012
Loading...

Share This Page