解决python写入中文乱码问题

解决python写入中文乱码问题:

添加encoding='utf-8-sig'

with open('result.csv', 'w', encoding='utf-8-sig', newline='') as f:
    writer = csv.writer(f)
    writer.writerows(data)
posted @ 2020-09-05 08:46  总得前行  阅读(873)  评论(0编辑  收藏  举报