问题描述: 获取了接口返回的json数据,然后按行读取所有数据,把想着数据写到txt时,中文总显示例如: u’u4e5du52a9u5e55 解决方法: 导入如下: import sys reload (sys) sys.setdefaultencoding('utf-8') 写文件时直接open后用write即可: file = open(str(f) + '.txt', 'w') #打开文本文件,如果没有将新建 file.write('orig_id:%s'%orig_id[b]+',')