打印未转义的空白字符至sh

2024-04-25 07:21:13 发布

您现在位置:Python中文网/ 问答频道 /正文

考虑这行Python代码:

s = "This string has \n\r whitespace"

我该怎么做

print s

给我

This string has \n\r whitespace

而不是

This string has
whitespace

就像现在一样。


Tags: 代码stringthishasprintwhitespace