utf 8 – Difference between n and rn in python

utf 8 – Difference between n and rn in python

n is the class Unix/linux style for new line.
rn is the default Windows style for line separator.
r is classic Mac style for line separator.
I think n is better, because this also looks good on windows, but some rn may not looks so good in some editor under linux, such as eclipse or notepad++.
If you are handling some protocols, the rn is usually required.

Code

print n,
print r,
print rn,

gives you the following output in hex

0a 0d 0d 0a

See also answers here and here.

utf 8 – Difference between n and rn in python

Leave a Reply

Your email address will not be published. Required fields are marked *