python3设置打开文件的编码

f = open(file_path,'r',encoding='utf8')

用起来很方便,不需要先读取再转码了。

posted @ 2016-03-20 18:59  catmelo  阅读(2896)  评论(0编辑  收藏  举报