'zip' module Flashcards
1
Q
zip = zipfile.ZipFile(‘file’, ‘mode’)
A
open a zip archive for manipulation
2
Q
zip.namelist()
A
list files in zip archive
3
Q
zip.infolist()
A
list metadata of the files in the archive
4
Q
zip.getinfo(x)
A
get metadata for specific file
5
Q
zip.read(x)
A
read file inside zip archive
6
Q
(b’string’)
A
specify string as bytecode. bytecode is an attribute of the code object, among many other attributes
7
Q
zip.extract(x)
A
extract x file from the archive
8
Q
zip.extractall()
A
extract all files from zip archive
9
Q
zip.close()
A
close zip file