Parsing json and searching through it

后端 未结 5 503
轮回少年
轮回少年 2020-12-02 23:26

I have this code

import json
from pprint import pprint
json_data=open(\'bookmarks.json\')
jdata = json.load(json_data)
pprint (jdata)
json_data.close()
         


        
5条回答
  •  佛祖请我去吃肉
    2020-12-03 00:06

    Seems there's a typo (missing colon) in the JSON dict provided by jro.

    The correct syntax would be:

    jdata = json.load('{"uri": "http:", "foo": "bar"}')
    

    This cleared it up for me when playing with the code.

提交回复
热议问题