python--遇到SyntaxError: Non-UTF-8 code starting with '\xb8' in file

在运行python中因为添加了中文注释,遇到SyntaxError: Non-UTF-8 code starting with '\xb8' in file

经过百度,说是Python的默认编码格式是UTF-8,若指定编码格式则需在开头添加如下代码:

#-*-coding:gb2312-*-
问题即可解决!!

 

posted @ 2019-06-19 10:41  正霜霜儿  阅读(10617)  评论(0编辑  收藏  举报