python文件对象如何将字节从当前种子位置移到末尾

2024-04-25 00:13:01 发布

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

python文件对象如何将字节从当前种子位置移到末尾

f = open(filename, "a+")

truncate_pos = f.tell()

f.truncate(truncate_pos)

好像不行,我怎么办?你知道吗


Tags: 文件对象pos字节openfilename种子末尾