7得票2回答
类似于文件对象的BytesIO

我不理解这两个BytesIO对象的区别。 如果我这样做: f = open('decoder/logs/testfile.txt', 'rb') file = io.BytesIO(f.read()) decode(file,0) 然后在解码方法中,这样做就可以了: for line ...