I have a text file with contents like the following
[[1, 4], [2, 6], [5, 7]]
[[1, 4], [2, 7], [5, 8]]
I would like to import the contents to SageMath/Python, and assign L=[[[1, 4], [2, 6], [5, 7]], [[1, 4], [2, 7], [5, 8]]].
I tried to use the following
with open('somefile.txt', 'r') as fp: L = [RDF(l.strip()) for l in fp.readlines()]
But there is some error: could not convert string to float: '[[1, 4], [2, 6], [5, 7]]'
How could I solve this problem? How to convert the values to integer (not float)? Thank you very much.