f.seek()碰到的问题
>>> f.seek(10,1)Traceback (most recent call last):
File "<pyshell#15>", line 1, in <module>
f.seek(10,1)
io.UnsupportedOperation: can't do nonzero cur-relative seeks
>>> f.seek(10,2)
Traceback (most recent call last):
File "<pyshell#16>", line 1, in <module>
f.seek(10,2)
io.UnsupportedOperation: can't do nonzero end-relative seeks 把完整代码发下 以文本模式打开文件时,seek第二个参数非0时,第一个参数只能是0,以二进制模式打开就没问题。貌似有个说法是文本模式打开的文件只允许从头计算偏移量。 {:5_110:}谢谢!
页:
[1]