Ok, you can take a look at the source code, Im currently using 1.5.5 as such
def load_workbook(filename, use_iterators=False):
if isinstance(filename, file):
if 'b' not in filename.mode:
raise OpenModeError("File-object must be opened in binary mode")
try:
archive = ZipFile(filename, 'r', ZIP_DEFLATED)
except (BadZipfile, RuntimeError, IOError, ValueError), e:
raise InvalidFileException(unicode(e))
wb = Workbook()
if use_iterators:
wb._set_optimized_read()
try:
_load_workbook(wb, archive, filename, use_iterators)
except KeyError, e:
raise InvalidFileException(unicode(e))
finally:
archive.close()
return wb
it looks like it closes the archive when we download the book, how about saving it?
def save(self, filename):
"""Write data into the archive."""
archive = ZipFile(filename, 'w', ZIP_DEFLATED)
self.write_data(archive)
archive.close()
it looks like it also closes the archive when we save it.
Excel , , , , , , .
, - openpyxl? , ? , .
, wb.save(filename = dest_filename), handled automatically , , , openpyxl , no class Workbook(object): __del__, , , 1.5.5 1.5.8, , , .