【发布时间】:2013-08-12 08:03:42
【问题描述】:
在Python中如何打印√、∞、²、³、≤、≥、±、≠等特殊字符
当我尝试将其打印到控制台时,我收到此错误:
print("√")
SyntaxError: Non-ASCII character '\xe2' in file /Users/williamfiset/Desktop/MathAid - Python/test.py on line 4, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
我该如何解决这个问题?
【问题讨论】:
-
抱歉没有回答我的问题
-
把
# code: utf-8放在源代码的第一行。