Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python extract all zip files from a directory

import zipfile, os
working_directory = 'my_directory'
os.chdir(working_directory)

for file in os.listdir(working_directory):   # get the list of files
    if zipfile.is_zipfile(file): # if it is a zipfile, extract it
        with zipfile.ZipFile(file) as item: # treat the file as a zip
           item.extractall()  # extract it in the working directory
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #extract #zip #files #directory
ADD COMMENT
Topic
Name
6+7 =