PythonでUnicode文字を文字列に「挿入」する方法はありますか? 例えば、
>>>import unicode
>>>string = u'This is a full block: %s' % (unicode.charcode(U+2588))
>>>print string
This is a full block: █
はい、ユニコード文字エスケープを使用:
print u'This is a full block: \u2588'
charcode に\udddd
置き換える場所を使用できます。dddd
print u"Foo\u0020bar"
版画
Foo bar
\u を使用して、Unicode 文字コードをエスケープできます。
s = u'\u0020'
空白文字を含む文字列を定義します。