gpt4 book ai didi

python - 如何在 python 中往复 fseek(fp, -1)

转载 作者:太空宇宙 更新时间:2023-11-04 08:56:06 25 4
gpt4 key购买 nike

大家好,我该如何返回

fseek(fp, -1)

在 python 中。因此在执行 fileObject.read(2) 之后我想将读头退后一步

最佳答案

import os
fileObject.seek(-1, os.SEEK_CUR)

可以找到有关seek 方法的更多信息in the Python documentation .

关于python - 如何在 python 中往复 fseek(fp, -1),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16952017/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com