I have a file which is a list of dictionaries in this way:
[{'text': 'this is the text', 'filed1': 'something1', 'filed2': 'something2', 'subtexts': [{'body': 'body of subtext1', 'date': 'xx'}, {'body': 'body of subtext2', 'date': 'yy'}}]
The list of nested dictionaries and lists can have multiples dicts and lists inside. I want to read the file which is written exactly like this in python and create a data structure (list of dictionaries). How can it be done knowing it's not json but it has written to file by file.write(str(list))
where list is something we want to read back from file?