Python gzip folder structure when zipping single file

前端 未结 4 1648

I\'m using Python\'s gzip module to gzip content for a single file, using code similar to the example in the docs:

import gzip
content = \"Lots of content he         


        
4条回答
  •  庸人自扰
    2021-01-13 17:11

    You must use gzip.GzipFile and supply a fileobj. If you do that, you can specify an arbitrary filename for the header of the gz file.

提交回复
热议问题