Python中如果有中文注释则通常会报错:

sys:1: DeprecationWarning: Non-ASCII character '\xe6' in file ./backup.pyw on line 7, but no encoding declared; 

        see http://www.python.org/peps/pep-0263.html for details。

这是因为文件中有非ASCII字符,需要在第一行或第二行指定编码声明。修改方法是,必须在第一行或者第二行加上

#coding=<encoding name>,<encoding name>应该与vi中的set fileencoding值相对应

相关文章:

  • 2021-11-17
  • 2021-09-24
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-01-23
猜你喜欢
  • 2021-04-25
  • 2021-11-21
  • 2021-05-29
  • 2021-11-07
  • 2022-12-23
  • 2022-02-09
  • 2022-02-15
相关资源
相似解决方案