python opens text file with a space between every character

前端 未结 8 1488
野性不改
野性不改 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:45

    Open the file in binary mode, 'rb'. Check it in a HEX Editor and check for null padding '00'. Open the file in something like Scintilla Text Editor to check the characters present in the file.

提交回复
热议问题