import os
fn = 'somefile.txt'
thefile = open(fn, 'r')
# The next line check the size of the file. Replace "stat(fn).st_size" with your own code if you want.
if stat(fn).st_size > 500:
thefile.seek(0, os.SEEK_END)
# you are now at the end of the file if the size is > 500
如果我理解你的问题,但我真的不确定,你可以取消缩进:
好吧,回答你的更新:
你所说的“到文件末尾”是指“查找文件末尾”吗?然后:
如果你的意思完全不同,你最好澄清一下!在
相关问题 更多 >
编程相关推荐