I have a file that contains information similar to the example shown below. I would like to know if there is a way to read this file using python and use it as json. I am aware of how to open it and process the text but is there another way?
Example:
key={{name='foo', etc..},{},{},{}}
If you want your content to be treated as json you need to have a valid json syntax:
Then you can use json library to convert it to a dictionary:
Additionally, if your file content cannot be changed to a correct json syntax, then you will need to develop a parser for your specific case.