摘要: seek() seek(n)光标移动到n位置,移动单位是byte,所有如果是utf-8的中文部分要是3的倍数,因为一个中文在utf-8是24位,3个字节。 通常我们使用seek都是移动到开头或者结尾 移动到开头:seek(0) ,但是实际上是seek(0,0) 移动到结尾:seek(0,2) see 阅读全文
posted @ 2019-07-26 22:24 套你大象 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 只读rb 非文字类,如图片视频,bytes类型,在rb模式下,不能encoding字符集 f = open('345',mode='rb') for line in f: print(f) print(f.readline()) print(f.readline()) print(f.readlin 阅读全文
posted @ 2019-07-26 22:17 套你大象 阅读(105) 评论(0) 推荐(0) 编辑