Which EOL should I use in general?

59 views Asked by At

I wondered if there was a EOL (end of line) to be privileged between \n, \r\n and \r (if my enumeration is right).

The question is in general and, especially about what a webserver should serve?

Bonus: if you can also tell me about Python specificity if such exist.

PS: As my question is, in a hand generic and in the other specific, I didn't know if I should have also tagged my question with the tag or not. Let me know.

EDIT: And is it just a matter of operating system related prob or is there some programs (or specifications) requiring or advising to use one more than the others? I found surprisingly not a lot of information about them. What am I doing wrong?

1

There are 1 answers

0
user2588667 On

For the web, \n doesn't do anything, you need a

<br>

For python, \n should be fine, but if you want to be REALLY safe, you could use

import os
os.linesep #this is the newline character on the OS that the code is running on

EDIT: formatting