samedi 23 juillet 2016

finding values under list python

Below is an example of my JSON file (which is pretty huge). I need to append multiple things. For key2, key3 I have appended easily since it a pretty easy thing, but when I am trying to append value1 and value2 from key1. it gives me TypeError: list indices must be integers, not str.

[
    {
    "key1": [
        {
            "value1": int, 
            "value2": "string", 
            "value3": "string", 
            "value4": "string", 
            "value5": "string", 
            "value6": int
        },
     ],
    "key2": some value,
    "key3": some value,
    },
],    

Aucun commentaire:

Enregistrer un commentaire