dett
dett

Reputation: 83

Python. The coding of a string

>>> word = '\u041a\u041e\u041b'
>>> print u'\u041a\u041e\u041b' 
КОЛ
>>> print word 
\u041a\u041e\u041b

How to transform string as a variable to a readable kind (how print word)?

Upvotes: 1

Views: 124

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798746

>>> print '\u041a\u041e\u041b'.decode('unicode-escape')
КОЛ

Upvotes: 6

Related Questions