python程序不支持中文

SyntaxError: Non-ASCII character '\xe8' in file delete.py on line 4, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

运行程序报上面的错误

解决方法:

1.在程序开头加入#coding:utf-8

#!/usr/bin/env python
# coding: utf-8

posted @ 2013-12-25 14:17  普拉多VX  阅读(631)  评论(0编辑  收藏  举报