DEV Community

abbazs
abbazs

Posted on

 

How to unzip multiple zip files in a folder using python?

import zipfile
from pathlib import Path
p = Path('.')
for f in p.glob('*.zip'):
    with zipfile.ZipFile(f, 'r') as archive:
        archive.extractall(path=f'./{f.stem}')
        print(f'Done {f.stem}')
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

One Million Strong

We are an active and inclusive community of over one million registered creators, developers, and tech enthusiasts. Join us.