Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python json to dict and back

import json

json_data = {"Some":"thing"}
             
''' From JSON to dict '''
dict_data = json.loads(json_data)[0] #access index 0 to extract dict fron list

''' From dict to JSON '''
json_data = json.dumps(dict_data)
 
PREVIOUS NEXT
Tagged: #python #json #dict
ADD COMMENT
Topic
Name
4+7 =