I am writing a program that stores data in a dictionary object, but this data needs to be saved at some point during the program execution and loaded back into the dictionar
Convert dictionary into JSON (string)
import json mydict = { "name" : "Don", "surname" : "Mandol", "age" : 43} result = json.dumps(mydict) print(result[0:20])
will get you:
{"name": "Don", "sur
Convert string into dictionary
back_to_mydict = json.loads(result)