摘要: python中出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare的错误可按照错误建议网址查看http://www.python.org/peps/pep-0263.html发现是因为Python在默认状态下不支持源文件中的编码所致。解决方案有如下三种:一、在文件头部添加如下注释码:# coding=<encoding name> 例如,可添加# coding=utf-8二、在文件头部添加如下两行注释码:#!/usr/bin/python# -*- coding: 阅读全文
posted @ 2012-02-06 23:38 qi09 阅读(13201) 评论(0) 推荐(1) 编辑