3 ms·
Just today I needed to write a .csv file in Python on Windows and got a file with CR CR LF line endings by default (\r\r\n). That was using the standard 'import
by larschdk 6y ago
Just today I needed to write a .csv file in Python on Windows and got a file with CR CR LF line endings by default (\r\r\n). That was using the standard 'import csv' in Python 3.
- hprotagonist 6y agoyeah you gotta pass with open(...,newline='') as f:
- JoBrad 6y agoI think the docs now include this.
- hprotagonist 6y agoyes, they have for some time now i think. I wish it was better known, though.