I was thinking that I wanted to extract the targz file on Windows, but I can do it in the following way, so I will record it.
extract_from_targz.py
import tarfile
import sys
args = sys.argv
with tarfile.open(args[1], "r:gz") as file:
file.extractall(path=args[2])
file.close()
>python extract_from_targz.py <targz filename> <Directory name after extraction>
Recommended Posts