`
cnDenis
  • 浏览: 99296 次
  • 来自: 广州
社区版块
存档分类
最新评论

Python2.x中支持unicode的configparser

阅读更多

Python2.x中支持unicode的configparser

by cnDenis http://cndenis.iteye.com 2013年1月16日

Python2.x中许多内置模块不支持unicode,确实是很烦的事。configparser就是其中之一。

解决方法是使用Python3.x中configparser的backport,http://pypi.python.org/pypi/configparser,下载后解压,把其中的configparser.pyconfigparser_helpers.py放到你的代码所在文件夹中。然后在import时把

1
import ConfigParser

改成

1
import configparser

就可以了。

参考:http://bugs.python.org/issue11597

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics