It depends on how correct you want to be.
will usually do the job. If you really want to get it right, you look up the newline character in the os
package. (It's actually called linesep
.)
Note: when writing to files using the Python API, do not use the os.linesep
. Just use
; Python automatically translates that to the proper newline character for your platform.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…