utf8 open escape python python-2.7 python-unicode unicode-escapes

open - unicode escape python



Eliminar unicode / u2026 como caracteres en una cadena en python2.7 (1)

>>> s ''This is some //u03c0 text that has to be cleaned//u2026! it//u0027s annoying!'' >>> print(s.decode(''unicode_escape'').encode(''ascii'',''ignore'')) This is some text that has to be cleaned! it''s annoying!

Tengo una cadena en python2.7 así,

This is some /u03c0 text that has to be cleaned/u2026! it/u0027s annoying!

¿Cómo lo convierto a esto?

This is some text that has to be cleaned! its annoying!