How can I convert the str representation of a dict, such as the following string, into a dict?
str
dict
s = \"{\'muffin\' : \'l
using json.loads:
json.loads
>>> import json >>> h = '{"foo":"bar", "foo2":"bar2"}' >>> d = json.loads(h) >>> d {u'foo': u'bar', u'foo2': u'bar2'} >>> type(d)