代码如下:
#! /usr/bin/python
print "你好!"
运行后报错如下:
SyntaxError: Non-ASCII character '\xc4' in file 1.py on line 3, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
解决方法:
#! /usr/bin/python
# -*- coding=UTF-8 -*-
print "你好!"