def untar(path, fname): print('unpacking ' + fname) fullpath = os.path.join(path, fname) shutil.unpack_archive(fullpath, path) os.remove(fullpath)