I want to read a CSV file's columns directly into variables. The result should be something like you would get with the following shell line: while IFS=, read ColumnName1 ColumnName2 ColumnName3 do stuff
So far the answer seems to be with csv.DictReader, but I have not been able to make it work. I do not have a header row, so column names would have to be created manually. (with a dictionary I think in the form mydictionary={ 'ColumnName1':0, 'ColumnName2':1, 'ColumnName3':3 } )
Also, can the columns be referenced as simple variable names or must you use a list[index] style reference. A code sample just printing the columns by name would be nice. Thanks for the help.