python opens text file with a space between every character

前端 未结 8 1619
野性不改
野性不改 2021-02-18 17:27

Whenever I try to open a .csv file with the python command fread = open(\'input.csv\', \'r\') it always opens the file with spaces between every single character.

8条回答
  •  囚心锁ツ
    2021-02-18 17:40

    The file is encoded in some unicode encoding, but you are reading it as ascii. Try to convert the file to ascii before using it in python.

提交回复
热议问题