0 python ascii non-ascii-characters
我试过这个:
print u"\u221A"
Run Code Online (Sandbox Code Playgroud)
但它在 Python 中不起作用。
有人能告诉我如何在 python 中做到这一点吗?我需要它来展示我所做的事情。
print u"\u221A".encode('utf-8')
Run Code Online (Sandbox Code Playgroud)
假设“不起作用”,你的意思是你得到了 UnicodeEncodeError 我在交互模式下运行你的代码。您的终端的编码可能会有所不同。