'tempfile' module Flashcards
1
Q
tempFile = tempfile.TemporaryFile()
A
create an instance of a temporary file
2
Q
tempFile.write(b”string”)
A
write binary literal to a temp file
3
Q
tempFile.seek(0)
A
reset seek pointer to position 0
4
Q
tempFile.read()
A
read temp file
5
Q
tempFile.close()
A
close temp file
6
Q
zip {.zip-filename} {filename-to-compress}
A
create a zip archive with compressed files