How to parse data in JSON format?

后端 未结 5 1656
梦谈多话
梦谈多话 2020-11-21 07:12

My project is currently receiving a JSON message in python which I need to get bits of information out of. For the purposes of this, let\'s set it to some simple JSON in a s

5条回答
  •  情歌与酒
    2020-11-21 07:51

    Very simple:

    import json
    data = json.loads('{"one" : "1", "two" : "2", "three" : "3"}')
    print data['two']
    

提交回复
热议问题