有没有办法在Python中将Unicode字符"插入"字符串?例如,
>>>import unicode
>>>string = u'This is a full block: %s' % (unicode.charcode(U+2588))
>>>print string
This is a full block: ?
Run Code Online (Sandbox Code Playgroud)
Eri*_*ric 11
是的,unicode字符转义:
print u'This is a full block: \u2588'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12703 次 |
| 最近记录: |