Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

Updated code to Python 3 as Python 2 is no longer supported as of January 1, 2020
Source Link

Is there a way to "insert" a Unicode character into a string in pythonPython 3? For example,

>>>import unicode
>>>string = u'This'This is a full block: %s' % (unicode.charcode(U+2588))
>>>print(string)
This is a full block: █

Is there a way to "insert" a Unicode character into a string in python? For example,

>>>import unicode
>>>string = u'This is a full block: %s' % (unicode.charcode(U+2588))
>>>printstring
This is a full block: █

Is there a way to "insert" a Unicode character into a string in Python 3? For example,

>>>import unicode
>>>string = 'This is a full block: %s' % (unicode.charcode(U+2588))
>>>print(string)
This is a full block: █
Source Link
tkbx
  • 16.4k
  • 34
  • 93
  • 123

Python unicode character codes?

Is there a way to "insert" a Unicode character into a string in python? For example,

>>>import unicode
>>>string = u'This is a full block: %s' % (unicode.charcode(U+2588))
>>>print string
This is a full block: █
lang-py

AltStyle によって変換されたページ (->オリジナル) /