I have string that looks like dictionary like this:
{"h":"hello"}
I would like to convert it to an actual dictionary as instructed here
>>> import json
>>>
>>> s = "{'h':'hello'}"
>>> json.load(s)
Yet, I got an error:
Traceback (most recent call last): File "", line 1, in File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 286, in load return loads(fp.read(),
AttributeError: 'str' object has no attribute 'read'
What is wrong to my code, and how I convert string like dictionary to actual dictionary? Thanks.