How can I write a function in python that that will take a string with multiple dictionaries, one per line, and convert it so that json.loads can parse the entire string in single execution.
For example, if the input is (one dictionary per line):
Input = """{"a":[1,2,3], "b":[4,5]}
{"z":[-1,-2], "x":-3}"""
This will not parse with json.loads(Input). I need to write a function to modify it so that it does parse properly. I am thinking if the function could change it to something like this, json will be able to parse it, but am not sure how to implement this.:
Input2 = """{ "Dict1" : {"a":[1,2,3], "b":[4,5]},
"Dict2" : {"z":[-1,-2], "x":-3} }"""