Python/Json:Expecting property name enclosed in double quotes

前端 未结 16 2366
南方客
南方客 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:50

    It is always ideal to use the json.dumps() method. To get rid of this error, I used the following code

    json.dumps(YOUR_DICT_STRING).replace("'", '"')
    

提交回复
热议问题