Pycharm adds a (hidden) enter at the end of a csv file

Basically when making a csv file using python there is a hidden enter character at the final line, in the IDE i can clearly see that there is a new line at the end (see attatched), but on a text editor there is no enter. this is messing up a few of my html files when drawing tables. i was wondering if there was a way to remove the end of that file.when removing the space in the IDE then checking the file in a text editor the size of the file changes about two bytes if that helps.

3 comments
Comment actions Permalink

Hi, please check the settings at **Preferences | Editor | General**, namely the Virtual Space and "Ensure every saved file ends with a line break". 

Try disabling everything.

1
Comment actions Permalink

Just checked Both those options are off.

 

0
Comment actions Permalink

Do I understand correctly that the file is generated by the Python code, and the issue is reproduced even if you don't open the file in the IDE or any other editor? Or is it reproduced only after you open the file in PyCharm, thus modifying it?

If it's the former case, then you probably should change the line separator of the output file (also called newline character) from the code.

0

Please sign in to leave a comment.