Start New Discussion within our Software Development Community


I just came accross the csv module to deals with csv files in python.

suppose my csv file has two rows:


and i want to access each item at a time, i.e., 1 followed by 2 and so on....what can be done?

import csv
reader= csv.reader(open('filename.csv','r'),delimiter=' ')
for row in reader:
print row

gives me

I want to access a single value at a time

Grib......... thanks for the reply, but it still gives me:


i want to access 1 first followed by 2, followed by 3 and so on....

I know there must be something pretty simple, but it's blocking me, need help :) was that simple! I couldn't get can i store the values in an array kind of structure? list is not helping me

This question has already been answered. Start a new discussion instead.