`
insertyou
  • 浏览: 866260 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

PYTHON 2.2 IDLE 中文字串处理设定方法

 
阅读更多
1.在 \python22\Lib\ 中的 site.py 第289行
encoding = "ascii" # Default value set by _PyUnicode_Init()

改为
encoding = "mbcs" # Default value set by _PyUnicode_Init()

2.将 \python22\tcl 中的资料夹
\python22\tcl\tcl8.3
\python22\tcl\tk8.3
复制到Lib中成为
\python22\Lib\tcl8.3
\python22\Lib\tk8.3

3.在 \python22\Tools\idle 中的 Outwindow.py 第37行
self.text.insert(mark, s, tags)
改为
self.text.insert(mark, unicode(str(s)), tags)
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics