
March 6th, 2002, 04:06 PM
|
|
#-------------------------
|
|
Join Date: Jan 2002
Location: you s of a
Posts: 35
Time spent in forums: < 1 sec
Reputation Power: 7
|
|
|
create zip archive
hi-
i am creating a zip file from a directory. it is working great, but the files in the subdirectories get put into the top level directory in the zip file. I want the directory structure to remain intact when i extract the zip file.
How can I do this? Any ideas? thanks a lot-
Mac
I am using this code, currently:
for name in glob.glob("mypath/*"):
if os.path.isfile(name):
file.write(name, os.path.basename(name), zipfile.ZIP_DEFLATED)
|