在python源码中使用中文注释,可能会报错,解决方案是: # coding=gb2312 #中文注释在这里 print("Hello World!") 或者使用方案: # -*- coding: gb2312 -*- #中文注释在这里 print("Hello World!")