with open("a.txt","r",encoding="utf-8") as f:
print("文件名是:{0}".format(f.name))
print(f.tell())
print("读取的内容:{0}".format(str(f.readline())))
print(f.tell())
f.seek(3)
print("读取的内容:{0}".format(str(f.readline())))
print(f.tell())
print("读取的内容:{0}".format(str(f.readline())))
print(f.tell())
seek() 要怎么做才能不报错?
中文报错 UnicodeDecodeError: 'utf-8' codec can't decode byte 0x98 in position 0: invalid start byte