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.
Ene Uran 638 Posting Virtuoso
Recommended Answers
Jump to PostHere 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 Replies
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
Ene Uran 638 Posting Virtuoso
BearofNH 104 Posting Whiz
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.