Python/Json:Expecting property name enclosed in double quotes

前端 未结 16 2329
南方客
南方客 2020-11-27 03:23

I\'ve been trying to figure out a good way to load JSON objects in Python. I send this json data:

{\'http://example.org/about\': {\'http://purl.org/dc/terms/         


        
16条回答
  •  抹茶落季
    2020-11-27 03:41

    with open('input.json','r') as f:
        s = f.read()
        s = s.replace('\'','\"')
        data = json.loads(s)
    

    This worked perfectly well for me. Thanks.

提交回复
热议问题