On Mon, May 18, 2009 at 12:34 PM, Dinesh B Vadhia <[email protected]> wrote: > The structure of the gzip files are: > > gzip archive > folderA > folderB > list of folderC's > each folderC contains the target files > > Within the archive, I want to open the gzip archive, open folderA, > openFolderB , get the list of target files in folderC, and extract each file > in folderC individually. > > I've used gzip before but cannot see how to move from folderA to folder B > within the archive. Any ideas?
Presumably the gzip file is a tar archive? If so see the examples for the tarfile module, they show something very similar to what you need. The fourth example shows how to see what is in the file and the first example shows how to filter it. http://docs.python.org/library/tarfile.html#examples Kent _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
