To tar and gzip multiple folders in Python, you can use the tarfile
, gzip
and shutil
modules.
main.py586 chars25 lines
To encode the contents of the tar file in base64, you can use the base64
module. Here's an updated code block:
main.py829 chars34 lines
Note that this code will remove the original tar and gzip files after encoding the contents in base64. If you want to keep them, comment out the lines with os.remove()
.
gistlibby LogSnag