python中文注释问题

学习python遇到的中文注释问题

错误提示

SyntaxError: Non-UTF-8 code starting with ‘\xb7’ in file hello_world.py on line
10, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for detai
ls

只需在第一行代码加入以下任意一条

#coding:gbk
#coding:utf-8
#-*-coding:gbk-*-

学习来源 https://blog.csdn.net/heilian56/article/details/51507528

你可能感兴趣的:(Python学习笔记,学习python的问题记录)