python append to array in json object -


i have following json object in python:

jsonobj = {           "a": {               "b": {                       "c": var1,                       "d": var2,                       "e": [],                    },                  },             } 

and append key-value elements "e", can't figure out syntax it. tried appending following, doesn't come out right brackets , quotes:

jsobj["a"]["b"]["e"].append("'f':" + var3) 

instead, want "e" following:

"e":[        {"f":var3, "g":var4, "h":var5},        {"f":var6, "g":var7, "h":var8},     ] 

does know right way append json array? appreciation.

jsobj["a"]["b"]["e"].append({"f":var3, "g":var4, "h":var5}) jsobj["a"]["b"]["e"].append({"f":var6, "g":var7, "h":var8}) 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -