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

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -