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.
假设我有一个原始字符串r'\n',对应于'\\n'. 有没有办法将原始字符串解释为'\n'具有换行意义的“正常”字符串?
r'\n'
'\\n'
'\n'
你可以得到一个换行符r'\n'.replace("\\n", "\n")
r'\n'.replace("\\n", "\n")