从python3到python3的行不能拆分

2024-05-16 21:44:29 发布

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

enter image description here

所以我在做我读文件时经常做的事情: 代码:

f= open(filename,'r')
t= f.read().splitlines()
print(t)

但我不知道为什么。 错误:

^{pr2}$

Tags: 文件代码read错误openfilename事情print