Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否有一个 EOL(行尾)在\n,\r\n和\r(如果我的枚举是正确的)之间享有特权。
\n
\r\n
\r
问题是一般性的,尤其是关于网络服务器应该提供什么服务?
奖励:如果您还可以告诉我有关 Python 的特殊性(如果存在的话)。
PS:我的问题是,一方面是通用的,另一方面是具体的,我不知道我是否应该也用python标签标记我的问题。让我知道。
编辑:这只是与操作系统相关的问题,还是有一些程序(或规范)要求或建议比其他程序多使用一个?我惊讶地发现关于他们的信息并不多。我究竟做错了什么?
对于网络,\n 不做任何事情,你需要一个
<br>
对于 python,\n 应该没问题,但如果你想真正安全,你可以使用
import os os.linesep #this is the newline character on the OS that the code is running on
编辑:格式化