Python:打印 FFFF 以外的 unicode 字符

4 string unicode python-3.x

在 Python 3 上,打印 unicode 字符可以这样打印:

print('\uFFFF')
Run Code Online (Sandbox Code Playgroud)

但是如何打印更高的 unicode 字符,例如 001FFFFF?print('\u001FFFFF') 只会打印 001F 作为 unicode 字符,然后打印 4 次 F。尝试使用 print('\u001F\uFFFF') 将导致 2 个 unicode 字符,而不是所需的字符。是否可以在Python 3中以某种方式打印unicode字符001FFFFF?

Mar*_*som 5

使用大写 U。

print('\U001FFFFF')
Run Code Online (Sandbox Code Playgroud)