Since there is so much discussion on one of the threads on zipping/unzipping files and all the associated incompatibilities, is there a way to do this with Python and cut out the middleman?

Recommended Answers

All 4 Replies

Python offers a number of modules providing easy file compression and decompression. Here are code snippets for two of the popular compression formats ...
zipfile -->
http://www.daniweb.com/code/snippet629.html
tarfile -->
http://www.daniweb.com/code/snippet630.html

Now that is fairly easy code to work with. I didn't know it was that simple. Does anyone have a particular preference of a compression format?

Another question, can zipfile archive several files like tarfile? How would you save the decompresed files?

Another question, can zipfile archive several files like tarfile? How would you save the decompresed files?

An omission on my part, I added another snippet to show you how to pack and unpack files to and from an archived zip file:
http://www.daniweb.com/code/snippet633.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.