I have a text file which contains matrix of N * M dimensions.
For example the input.txt file contains the following:
You can do this:
fin = open('input.txt','r') a=[] for line in fin.readlines(): a.append( [ int (x) for x in line.split(',') ] )