s = '''大湘菜''' print(s)
结果会报错:
SyntaxError: Non-UTF-8 code starting with '\xb4' in file D:\Pycharm\pythonProject\main.py on line 1, but no encoding declared; see https://python.org/dev/peps/pep-0263/ for details
只需要在最开始添加:
#coding=UTF-8
或:
# -*- coding:UTF-8 -*-
即可