Python 3 CSV file giving UnicodeDecodeError: 'utf-8' codec can't decode byte error when I print

前端 未结 7 579
梦如初夏
梦如初夏 2020-12-03 01:18

I have the following code in Python 3, which is meant to print out each line in a csv file.

import csv
with open(\'my_file.csv\', \'r\', newline=\'\') as csv         


        
7条回答
  •  眼角桃花
    2020-12-03 01:35

    I also faced the issue with python 3 and my issue got resolved using the encoding type as utf-16

    with open('data.csv', newline='',encoding='utf-16') as csvfile:
    

提交回复
热议问题