网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  python--遇到SyntaxError: Non-UTF-8 code starting with 'xb8' in file

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

分类: IT文章 • 2024-05-23 10:42:49

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

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

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

相关推荐

  • python--遇到SyntaxError: Non-UTF-8 code starting with 'xb8' in file
  • SyntaxError: Non-UTF-8 code starting with 'xc5' in file t.py on line 3,but no encoding declared;see http://python.org/dev/peps/pep-0263/ for details
  • pyinstaller使用错误 SyntaxError: Non-UTF-8 code starting with 'xb4' in file C:......
  • SyntaxError: Non-UTF-8 code starting with 'xba' in file 错误的解决方法!!
  • SyntaxError: Non-UTF-8 code starting with '\xc1' in file.
  • python 1、python--遇到SyntaxError: Non-UTF-8 code starting with 'xb8' in file
  • Spring系列__02IOC模块简介 依赖注入和依赖查找的介绍 Spring中的控制反转 1.bean的配置
  • 实验三 Java基本程序设计
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号