I want to load list in list from text file. I went through many examples but no solution. This is what I want to do I am new bee to python

def main()
    mainlist = [[]]
    infile = open('listtxt.txt','r')
    for line in infile:
        mainlist.append(line)

    infile.close()

    print mainlist

`[[],['abc','def', 1],['ghi','jkl',2]]`

however what I want is something like this

[['abc','def',1],['ghi','jkl',2]]

my list contains

'abc','def',1
'ghi','jkl',2
'mno','pqr',3

what I want is when I access the list print mainlist[0] should return

'abc','def',1

any help will be highly appreciated Thanks,

Edit
Report