Today a friend gives a demand:
Come on.
{' IsOK ': 1, ' isrunning ': None, ' IsError ': none}
How to convert into a dictionary
Well, one look is that JSON conversion is simple and begins:
Live out not to result, also reported wrong, check two hours of Baidu, did not understand.
Finally, the direct copy of the online code, OK, run successfully, but put my a variable, no, error; Start comparing two variables what is different, always thought that the double quotation marks in Python can be used casually, meaning unchanged; Finally, Baidu knows the standard format of JSON: requirements must be You can use only double quotation marks as the boundary symbol for a key or value, you cannot use single quotes, and the key must use a boundary character (double quotation marks)
Changed after the OK.
Perhaps other languages such as PHP,JS can recognize non-standard JSON formats, but Python does not;
Question: How does python convert to dict like a variable? The premise is that the volume of data is large .....
Above this python processing JSON string into a dictionary simple implementation is the small part to share all the content of everyone, I hope to give you a reference, but also hope that we support the script home.