txt 文件中的文本:
It is a... \nof a page when looking at its layout
编码:
f = open('f.txt', 'r')
s_list = f.readlines()
current_quest = 0
print(s_list[current_quest])
结论:
It is a... \nof a page when looking at its layout
应该是这样的:
It is a...
of a page when looking at its layout
好吧,您可以进行替换,例如
用一个字符替换 2
\n个字符,这意味着换行通常,使用允许您解码转义序列的标准函数