How to read from a text file compressed with 7z?

前端 未结 3 899
梦如初夏
梦如初夏 2020-12-10 14:25

I would like to read (in Python 2.7), line by line, from a csv (text) file, which is 7z compressed. I don\'t want to decompress the entire (large) file, but to stream the li

3条回答
  •  长情又很酷
    2020-12-10 15:14

    If you were using Python 3.3+, you might be able to do this using the lzma module which was added to the standard library in that version.

    See: lzma Examples

提交回复
热议问题