def compress(files, compressName):
    """
        Compress all the given files to a tar.gz archive
        Additionally remove all the given files (other than
        the archive) after compression.
    """
    tar = tarfile.open(compressName, "w:gz")
    for fileName in files:
        tar.add(fileName)
        os.remove(fileName)
    tar.close()

        Compress all the given files to a tar.gz archive
        Additionally remove all the given files (other than
        the archive) after compression.
    
recipes/Python/286171_Dumping_loading_variables_ascii/recipe-286171.py