I've a string of the form "text: u'\u0644'", how to extract in python the inner unicode string? (i.e. to have u'\u0644')
When I use split() I got "u'\\u0644'" which is a simple string!
You can use ast.literal_eval() to safely convert the literal string:
>>> from ast import literal_eval
>>> s = "text: u'\u0644'"
>>> unicode_part = s.split(':')[-1].strip()
>>> unicode_part
"u'\\u0644'"
>>> unicode_string = literal_eval(unicode_part)
>>> unicode_string
u'\u0644'
>>> print unicode_string
ل
:, hence using : for the split. If you could be certain that there was always a space, then you could split on the space, or even on : if there was always one space and avoid the .strip() - but this way is probably more robust.
json.loadsto decode it to Python data structures.