import tarfile tmp_tar_dir = /home file_name = test.tar.gz tmp_dir = /home/centos soft_name = php tar = tarfile.open(os.path.join(tmp_tar_dir,file_name),w:gz) for