A request object that I'm dealing with has the following value开发者_Go百科 for the key "address":
u"{u'city': u'new-york', u'name': u'Home', u'display_value': u'2 Main Street'}"
I need to operate on this unicode object as a dictionary. Unfortunately, json.loads() fails because it is not a json compatible object.
Is there any way to deal with this? Do I have to work with the the json.JSONDecoder object?
>>> ast.literal_eval(u"{u'city': u'new-york', u'name': u'Home', u'display_value': u'2 Main Street'}")
{u'city': u'new-york', u'name': u'Home', u'display_value': u'2 Main Street'}
精彩评论