I have a data string mainly containing objects with objects.
{"id":"XXXX", "name": "xyz", "user" : { "id": "XXXX", "username":"XYZ", group:{"id": "XXXX"}}}. You can check this format using "http://chris.photobooks.com/json/default.html" site.
It is not my requirement to convert this to JSON objects as a dictionary. I tried below.
import json JSON_Datalist = '{"id":"XXXX", "name": "xyz", "user" : { "id": "XXXX", "username":"XYZ", group:{"id": "XXXX"}}}' the_dict = json.loads(JSON_DataList)
but the_dict gives only the values โโof the left side, does not have the correct values โโ...
Similarly, if the string has a format.
"[{"sample": false, "radop": null, "view": true, "Example1": null}, {"noMarket": false, "Example2": null}]"
and following the same code.
JSON_Datalist = '[{"sample": false, "radop": null, "view": true, "Example1": null}, {"noMarket": false, "Example2": null}]' the_dict = json.loads(JSON_DataList)
it gives a dictionary of length 2, and this is what was expected ...
Can someone help me in the first case, how can I get the dictionary ...