python3 csv 中文乱码【centos系统】
办法一
def writeData(self, movieList):
with open('81.csv', 'w', encoding='utf_8_sig', newline='') as f:
writer = csv.DictWriter(f, fieldnames=['content'])
writer.writeheader()
for each in movieList:
print(each)
writer.writerow(each)
办法二
import codecs
csvfile.write(codecs.BOM_UTF8)