I am looking for a good example of the tarfile module, writing to and reading from an archive. Particularly the highly compressed filename.tar.bz2 format.
Jump to Post
Here is an example:
import tarfile # uncompressed = "w" use extension .tar # gzip compressed = "w:gz" dito .tar.gz # bzip2 super compressed = "w:bz2" dito .tar.bz2 tar = tarfile.open("sample.tar.bz2", "w:bz2") # turn three regular files into a tar file archive for name in ["test1.py", "test2.py", …
All 3 RepliesReply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.