其他分享
首页 > 其他分享> > Day3-R+/W+ seek, tell

Day3-R+/W+ seek, tell

作者:互联网

'''
# R+ read and write
f = open("yesterday",'r+',encoding="utf-8")
print(f.readline())
print(f.tell())
f.write("---------first line-------------")
print(f.readlines())

'''
#w+ write and read
f = open("yesterday",'w+',encoding="utf-8")

print(f.tell())
f.write("---------first line-------------")
print(f.tell())
f.seek(10)
print(f.readline())
f.write("-------------------second line-------------")
f.write("-------------third line----------------")

标签:utf,encoding,Day3,write,print,line,seek,tell
来源: https://www.cnblogs.com/carol7258/p/12852953.html