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

Latest comments (0)

16 Libraries You Should Know as a React Developer

>> Check out this classic DEV post <<