[Python] json object conversion error expected string or buffer python

【problem】

Today json conversion in use in python encounter a problem:

 

 

 

 

 

 

solution:

Reason: python default string representing single quotes " '" Therefore, when, after the character string value, Python will double quotes is converted to single quotes.

The json is not supported by single quotes. Can be converted by the following method:

json_string=json.dumps(primaryresult)
resultjson=json.loads(json_string)

 

Guess you like

Origin www.cnblogs.com/luckly-hf/p/12212593.html