parsing json fields in python

后端 未结 2 1867
南方客
南方客 2021-02-06 05:08

Is there a good tutorial on parsing json attributes in python? I would like to be able to parse the true value for \"ok\" field. As well as the index named \"client_ind_1\". I d

2条回答
  •  遇见更好的自我
    2021-02-06 05:42

    import json
    dct = json.loads(my_json_str)
    is_ok = dct['ok']
    client_index = dct['indices']['client_ind_2']['index']
    

提交回复
热议问题