Hi annannienann,
For CSV's I would take a good look at the csv module documentation, but, looking at your txt file input you should be able to use the .split() string method to split the input on commas, and, because this returns a list of strings, you could use a list of lists as a 2D array something like the following (untested):
Code:
txtfile = ...
data = []
for line in txtfile:
data.append( line.rstrip().split(',') )
- Paddy.
P.S. It is not good to re-assign file - it is a Python built-in function. (Thats why I have used txtfile).