Jan-22-2023, 12:57 AM
Greetings!
I'd like to extract files only, without the directories they are in, in the ZIP.
I wrote a small script but it extracts files with the directories.
Could you help me with this, please?
Thank you!
I'd like to extract files only, without the directories they are in, in the ZIP.
I wrote a small script but it extracts files with the directories.
Could you help me with this, please?
from zipfile import ZipFile zp_dr = 'C:\\02\\ZP_Files\\my.zip dir_out = 'C:\\02\\ZP_Out with zipfile.ZipFile(zp_dr) as zz: for file in zz.namelist(): if 'Trace' in file : print (f"ZIP Item : {file}") zz.extract(file,dr_out)Any help is appreciated.
Thank you!