python写入中文到文件乱码的问题

file = open(filename,'a',encoding='utf8')#指定写入编码为utf8,否则写入中文会乱码

 

posted @ 2016-06-07 16:03  殊胜  阅读(13560)  评论(0)    收藏  举报