在打开要写入的文件的时候,encoding='utf-8-sig',末尾加上一句newline=''即可 with open('./data/ant-man.csv','w', encoding='utf-8-sig',newline='') as f:
pycharm 中 file was loaded in the wrong encoding utf-8 和 csv的writerow写入的文件会有空行
最新推荐文章于 2022-03-23 12:06:44 发布
在打开要写入的文件的时候,encoding='utf-8-sig',末尾加上一句newline=''即可 with open('./data/ant-man.csv','w', encoding='utf-8-sig',newline='') as f: