SyntaxError: Non-UTF-8 code starting with '\xbb' in file D:\流畅学python\ex32.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
1. 报错如下:
SyntaxError: Non-UTF-8 code starting with '\xd3' in file D:\流畅学python\ex34.py on line 4, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
2. 解决办法:
1> 首行添加 # -*- coding:utf-8 -*-
2> 更改编码格式
File-> Settings-> Editor-> File Encodings 全改为UTF-8就可以了
3. 转自:
PyCharm注释中出现中文运行报错的解决办法 - 纪宇-年华 - 博客园 (cnblogs.com)