

\n when reading files with mode specifier rU. Means that no matter what the file line ending is, it will all be translated to Python 2 and Python 3 have different way of handling newlines. You can see that these two actions combined will start a new line ready Which means to move the paper a little higher so that you can type on a new Put the carriage to its left-most position. represents carriage return, which means to

and date back to the old time when typewriters is used for On older Mac 1, (byte code 0x0D) is used. On Linux, (byte code 0x0A) is used to represent On Windows, (byte code 0x0D0x0A) is used to

Newline characters on different platformsĭue to historical reasons, different platforms use different characters to Post, I want to share what I have learned about newline handling in variousĬases. Every programmer knows newline character, but may be not so familiar.
