PYTHON 2.2 IDLE 中文字串处理设定方法
2006-07-02 22:55
831 查看
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)
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)
相关文章推荐
- PYTHON 2.2 IDLE 中文字串处理设定方法
- Python2中文处理纪要的实现方法
- python3 中文乱码与默认编码格式设定方法
- Python requests库解析中文网页乱码处理方法
- Python 2.7中文显示与处理方法
- Python读写Json涉及到中文的处理方法
- 中文编码相关,python处理gbk编码的xml文件方法
- linux 系统下python程序中出现中文的处理方法
- sqlite3 jdbc、c接口、python接口处理中文时遇到的问题及其解决方法
- python 处理中文时出现的错误'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)" 解决方法
- Python点滴02_Python3打开中文文本时报错的一种处理方法
- 【随笔记录】python 处理中文时出现的错误'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)" 解决方法
- 基于python 处理中文路径的终极解决方法
- python中文处理好方法
- sqlite3 jdbc、c接口、python接口处理中文时遇到的问题及其解决方法
- python3访问sina首页中文的处理方法
- Python读写Json涉及到中文的处理方法
- python 字典中文key处理,读取,比较方法
- python 处理中文时出现的错误'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)" 解决方法
- Python处理中文文本字符时提取某个汉字或字符的方法