运行python程序时出现“ SyntaxError:文件中非ASCII字符'\ xfe'”错误

alw*_*btc 1 python windows encoding

虽然我包括

# -*- coding: utf-8 -*-
Run Code Online (Sandbox Code Playgroud)

在python文件的第一行中,我不断

SyntaxError: Non-ASCII character '\xfe' in file C:\Users\user\PycharmProjects\my_project\my_script.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
Run Code Online (Sandbox Code Playgroud)

我在Windows 7上使用PyCharm Community Edition。请提供帮助。

tri*_*eee 5

您的文件未另存为UTF-8。您很可能已保存了一些旧的8位编码(ISO-8859-1等)。