I have unicode u\"{\'code1\':1,\'code2\':1}\" and I want it in dictionary format.
u\"{\'code1\':1,\'code2\':1}\"
I want it in {\'code1\':1,\'code2\':1} format.
{\'code1\':1,\'code2\':1}
I
You can use the builtin eval function to convert the string to a python object
eval
>>> string_dict = u"{'code1':1, 'code2':1}" >>> eval(string_dict) {'code1': 1, 'code2': 1}