簡體   English   中英

蟒蛇。 字符串編碼

[英]Python. The coding of a string

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

如何將字符串作為變量轉換為可讀類型(如何打印單詞)?

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM