To run this:
pip3 install -r requirements.txt-
Output:
python tar.py --helpusage: tar.py [-h] [-t TARFILE] [-p PATH] [-f FILES] method TAR file compression/decompression using GZIP. positional arguments: method What to do, either 'compress' or 'decompress' optional arguments: -h, --help show this help message and exit -t TARFILE, --tarfile TARFILE TAR file to compress/decompress, if it isn't specified for compression, the new TAR file will be named after the first file to compress. -p PATH, --path PATH The folder to compress into, this is only for decompression. Default is '.' (the current directory) -f FILES, --files FILES File(s),Folder(s),Link(s) to compress/decompress separated by ','. - If you want to compress one or more file(s)/folder(s):
This will compress the folder
python tar.py compress -f test_folder,test.txttest_folderand the filetest.txtinto a single TAR compressed file named:test_folder.tar.gzIf you want to name the TAR file yourself, consider using-tflag. - If you want to decompress a TAR file named
test_folder.tar.gzinto a new folder calledextractedfor instance:A new folderpython tar.py decompress -t test_folder.tar.gz -p extractedextractedwill appear that contains everything ontest_folder.tar.gzdecompressed.