I am using the Python gzip module for gzip content for a single file, using code similar to the example in the docs:
import gzip content = "Lots of content here" f = gzip.open('/home/joe/file.txt.gz', 'wb') f.write(content) f.close()
If I open the gz file in 7-zip, I will see a folder hierarchy corresponding to the path that I wrote gz, and my content is nested in several folders in depth, for example / home / joe in the above example, or C: β Documents and settings β etc. On Windows
How can I get a single file that I clamp to only be in the root directory of the gz file?
source share