此消息最初是一个集合,然后我用 str(a) 转换为字符串
a = "Let\u2019s trade!\n\u00a0\n\nAn Old Friendship, A New Day!\nHere comes the old, visiting at your home.\nIt comes with a new story, about how to live the present, about how in his past he did wrong.\n\nThe new day shines andx2"
出于某种原因,当我打印它时
print(a)
它保留所有 \n 和 \u2019s 并且不会将其格式化为新行或将 \u2019 格式化为“'”右引号..所以它只是以纯文本形式显示
Let\u2019s trade!\n\u00a0\n\nAn Old Friendship, A New Day!\nHere comes the old, visiting at your home.\nIt comes with a new story, about how to live the present, about how in his past he did wrong.\n\nThe new day shines andx2
通常如果我这样做
print("Let\u2019s trade!\n\u00a0\n\nAn Old Friendship, A New Day!\nHere comes the old, visiting at your home.\nIt comes with a new story, about how to live the present, about how in his past he did wrong.\n\nThe new day shines andx2")
它将输出为
Let’s trade!
An Old Friendship, A New Day!
Here comes the old, visiting at your home.
It comes with a new story, about how to live the present, about how in his
past he did wrong.
The new day shines and
我该如何解决?