seek()值怎么?。吭趺从?? 012?
f?=?open('hello',?'a+') f.seek(0) a?=?f.read() print(a) f.seek(0) f.write('aaaa')
上述代碼,為什么aaaa,寫到了文件最后面
f?=?open('hello',?'a+') f.seek(0) a?=?f.read() print(a) f.seek(9) b=f.read() print(b)
seek()里面寫幾就從第幾位開始取,這個0開頭1當前位置2結束相違背呀~
2022-08-16
當使用了 追加模式時,seek()函數沒有作用