I want to convert a string which is like that:
{u'confirm_token': u'98c21e111f25550943e29e34e65ae1dd71968ff652cb933c2f998e4f',
u'confirmed_account': False, u'confidential': {}, u'contacts': [],
u'_id': ObjectId('4e0a761d7c93dd25bc000021'), u'settings': {u'email': u''},
u'here': [], u'creation_date': datetime.datetime(2011, 6, 29, 2, 47, 25),
u'profil': {u'gender': u'Male', u'first_name': u'Test', u'last_name': u'Test',
u'email_address': u'[email protected]', u'photo': u'picture.png'},
u'attending': [], u'requests': [],
u'password': u'b04b55d5f4555e5d7252e7f74aaf4dc538639fa6864f3d8004c61635'}
to a dictionary in Python. I actually tried to use the function json.load() but it doesn't work because of the Unicode before each keys and values. Does anyone know how to do it?
eval? Where are you getting this string from?.replace("u'", "'"), but that's horribly fragile.