I am trying to read the text-file containing a list of lists containing tuples of coordinates. How do I read the file so that I would get a list of lists?
The sample content of the text file is,
[(75, 143), (187, 138)]
[(85, 140), (193, 134)]
[(65, 120)]
.
.
.
.
.
I tried to read the file using the code below. It is able to read the file. But it is storing it in 'x' as str rather than a list. How to convert it to list?
filename1 = 'testfile.txt'
m_text = open(Filename1,'r+')
m_List = []
with open(Filename1) as mf:
x = mf.readlines()