json - Access the string value from a Dictionary -


i have following code :

a= {'b': '{"c":46, "d": 1}', 'e': 10}   

here need value of "c" in dictionary inside dictionary, value of 'b' dictionary in string format.

thanks in advance..!!

you have decode string value json format python object following (using python's json module):

import json  b_value = json.loads(a['b']) # decode value json string c_value = b_value['c'] # use/access value 

Popular posts from this blog

javascript - Js, document.getElementById("ID").innerHTML, error -

jquery - jqGrid update specific column data with out refreshing the entire column? -

objective c - Is there a way in OCMockito to make stubs fail when an unknown method is called? -