Wxpython跨平台安装

python2.6处理中文乱码问题解决

Sandy posted @ May 06, 2009 10:31:17 AM in Python , 3389 阅读

运行脚本,内有中文,出现错误

 

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128)

 

解决方法: 

 

#coding=utf8
import sys
reload(sys)
sys.setdefaultencoding("utf-8")

 

 

 

  • 无匹配

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter