I have a string formatted as a list of lists in a file. How can I get this into a variable in Python as a list?
E.g. data-string.txt
with open('data-string.txt') as f:
str = f.read()
and
str = "[[1, 2, 3], [2, 3, 4], [3, 4, 5]]"
are equivalent. How can I get this into a real Python list? I have looked into splitting using multiple delimiters, but if that's the right way I haven't been able to set it up correctly.