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