zipfile.ZipFile.close()
zipfile.ZipFile.close() is a Python method in the Zipfile Module category. Closes the ZIP file and flushes any unwritten data. The syntax is ZipFile.close(). Returns: None. A typical example: z = zipfile.ZipFile("a.zip", "w")
z.write("file.txt")
z.close(). A close sibling is zipfile.ZipFile(), which opens a ZIP file for reading, writing, or appending. A close sibling is zipfile.ZipFile.extractall(), which extracts all ZIP contents into the current or specified directory. A close sibling is zipfile.ZipFile.extract(), which extracts a single file from the ZIP archive. A close sibling is zipfile.ZipFile.namelist(), which returns a list of all files and directories in the ZIP archive. More about this category: ZIP archive handling — ZipFile, extract, extractall, namelist. Related Zipfile Module entries: zipfile.ZipFile(), zipfile.ZipFile.extractall(), zipfile.ZipFile.extract(), zipfile.ZipFile.namelist(), zipfile.ZipFile.getinfo(), zipfile.is_zipfile(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details.