比如text本来是:
To see a world in a grain of sand
And a heaven in a wild flower
Hold infinity in the palm of your hand
And eternity in an hour
输出为:
And eternity in an hour
Hold infinity in the palm of your hand
And a heaven in a wild flower
To see a world in a grain of sand
我的代码如下:
Line11显示错误:telling position disabled by next() call,请问如何修改?
with open('test.txt','r', encoding ='utf-8') as f:
index =len(f.readlines())-1
for i in range(index, -1, -1):
print(f.readlines()[i])
可以参考