报错信息:
SyntaxError: Non-UTF-8 code starting with ‘\xcd’ in file D:\E\pythoncode\pachongDemo\demo.py on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
报错截图:
解决办法:
在首行(第一行)加上:
#coding:utf-8
即可!
2、如若不行,需要设置pycharm默认编码为utf-8!
File——Settings