Wxpython跨平台安装

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

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

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

 

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")

 

 

 

  • 无匹配
boardmodelpaper.com 说:
2024年1月17日 05:06

Board Model Papers 2024 Download with Suggestions for 10th Class Textbooks 2024 Pdf Download and SSLC New Syllabus Sample Question Paper 2024 and different types of model papers boardmodelpaper.com and question papers for following the website and Arts, Science, Commerce Stream Subject Wise Solved Question Bank for Hindi & English Medium Students with Exam Pattern & Blueprint and subject Wise with 11th & 12th Question Bank 2024 for General & Vocational Course Languages & Subjects Important Question for the above link.


登录 *


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