<ia*******@hotmail.com> wrote:
Does Python have any internal facility for creating recursive archives
of a directory? I'd like to avoid reliance on extenal tools
(winzip,tar,etc).
import os, sys, zipfile
directory = sys.argv[1]
zip = zipfile. ZipFile(directory + ".zip", "w")
for path, dirs, files in os.walk(directory):
for file in files:
file = os.path.join(path, file)
print file, "..."
zip.write(file)
print "done"
tweak as necessary.
(did you even look in the library reference, btw?)
</F>