Gregory Lund wrote:
> if item.endswith('.zip'):
> # Combine the base folder name with the subpath to the zip file
> fullpath = os.path.join(outDir, item)
> x = zipfile.ZipFile(fullpath,'a')
Why did you change file mode to "a"?
> x.extractall()
> x.close()
> I tried to use:
> x.extractall(fullpath) but that of course gave me errors because
> 'fullpath' is the path of the file.
> I need to figure out how to just list the respective Lab_2\aforker,
> Lab_2\allisw99 folders.
>
> Thus far, I have not had any luck.
> Does python have a way to go back to the relative folder where the zip
> is located?
dest_path = os.path.dirname(fullpath)
x.extractall(dest_path)
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor