Writing then reading in-memory bytes (BytesIO) gives a blank result

后端 未结 2 1520
夕颜
夕颜 2020-12-13 23:45

I wanted to try out the python BytesIO class.

As an experiment I tried writing to a zip file in memory, and then reading the bytes back out of that zip file. So inst

2条回答
  •  误落风尘
    2020-12-14 00:16

    You need to seek back to the beginning of the file after writing the initial in memory file...

    myio.seek(0)
    

提交回复
热议问题