针对列表无法正常输出汉字的解决方法:
#encoding=utf-8
import json
list_words =['你','我','他']
print( list_words ) # 无法正常显示汉字
print( str(list_words).decode('string_escape')) # 正常显示汉字
list_words_result = json.dumps( list_words, encoding='UTF-8', ensure_ascii=False)
print( list_words_result )
输出结果为:
['\xe4\xbd\xa0','\xe6\x88\x91','\xe4\xbb\x96']
['你','我','他']
["你","我","他"]