今天的一些收藏:
一个自动检测file或url是什么编码的模块,很方便
http://chardet.feedparser.org/

一个自动检测file或url是什么编码的模块,很方便
http://chardet.feedparser.org/
>>> import urllib一个Mac下的音频处理工具
>>> urlread = lambda url: urllib.urlopen(url).read()
>>> import chardet
>>> chardet.detect(urlread("http://google.cn/"))
{'encoding': 'GB2312', 'confidence': 0.99}



0 Comments:
发表评论
<< Home