文件句柄W模式

f1=open('lo',encoding='utf-8',mode='w')
f1.write('w4567')
print(f1.tell())
f1.close()

#tell 告诉指针的位置(按字节)
#seek(参数),seek(0,2) 调至最后 按照字节去调整光标的位置

with open('lo',encoding='utf-8') as f1:
print(f1.read()
#with open()as:
posted @ 2018-04-17 22:46  dongyanyan  阅读(224)  评论(0编辑  收藏  举报