Skip to main content
 首页 » 编程设计

Python。字符串的编码

2025年05月04日22EasonJim

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

如何将字符串作为变量转换为 可读的那种(怎么打印字)?

请您参考如下方法:

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