SyntaxError: Non-ASCII character ‘\xe8’ in file /Users/xxx/PycharmProjects/Test/main.py on line 3

同事们好多都在学python我也心里痒痒搞了个IDE想学学,科室遇到这个问题了,经过翻查资料找到了解决方案,就是文件编码的问题,只要设置好编码就行了。

     在文件头添加编码设置:
    # -*- coding: cp936 -*-
    或者
    # -*- coding: utf-8 -*
0 0 vote
Article Rating
Subscribe
提醒
guest
0 评论
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x