samwyse wrote: > I've got an app that's creating Open Office docs; if you don't know, > these are actually ZIP files with a different extension. In my case, > like many other people, I generating from boilerplate, so only one > component (content.xml) of my ZIP file will ever change. Instead of > creating the entire ZIP file each time, what is the cheapest way to > accomplish my goal? I'd kind-of like to just write the first part of > the file as a binary blob, then write my bit, then write most of the > table of contents as another blob, and finally write a TOC entry for > my bit. Has anyone ever done anything like this? Thanks. I think you intend on using simply the command-line infozip tool from python system commands: mycmd = "zip -r content.xml foo.zip" mycmd = "zip -i your.blob foo.zip" try: mycmd = "zip -r content.xml foo.zip" retcode = call(mycmd, shell=True) mycmd = "zip -i your.blob foo.zip" retcode = call(mycmd, shell=True) if retcode < 0: print >>sys.stderr, "Child was terminated by signal", -retcode else: print >>sys.stderr, "Child returned", retcode except OSError, e: print >>sys.stderr, "Execution failed:", e
-- http://mail.python.org/mailman/listinfo/python-list