Feb-12-2021, 03:26 AM
Hi,
I hope you have better weather than we have tonight in Portland Oregon.
Anyway,
I need to extract a specific file that starts with the word "Debug*.log" from an archive.
An archive may or may not have the file, also the archive is actually a zipped directory with SubDirs and files.
The file I'm looking for could be any of the SubDirs.
I tried to use "zip.namelist" but it only prints files but not recursively,
I understand I need to test the Archive first but not sure how to do that.
Thank you.
I hope you have better weather than we have tonight in Portland Oregon.
Anyway,
I need to extract a specific file that starts with the word "Debug*.log" from an archive.
An archive may or may not have the file, also the archive is actually a zipped directory with SubDirs and files.
The file I'm looking for could be any of the SubDirs.
I tried to use "zip.namelist" but it only prints files but not recursively,
1 2 3 4 5 |
zip_filepath = 'C:\\02\\TEST-3.zip' target_dir = 'C:\\03\\' zip = zipfile.ZipFile(zip_filepath) print ( zip .namelist()) |
Thank you.