AnsweredAssumed Answered

Unzip files from directory tree

Question asked by yaron148 on May 19, 2015
Latest reply on Jun 2, 2015 by yaron148
Branched to a new discussion

Continusally to Unzip zip files in folders and subfolders with python - i didn't get an answer. i  work with python 2.7.8 and arcmap 10.3

and i don't why this code does not work with python 2.7.8:

  1. import zipfile   
  2. import arcpy,os,os.path,sys 
  3. from arcpy import env 
  4.  
  5. pattern = '*.zip' 
  6. folder = r"C:\Project\layers"  
  7. files_process = [] 
  8. for root,dirs,files in os.walk(r"C:\Project\layers"): 
  9.     for filenames in files: 
  10.         if filenames == pattern: 
  11.             files_process.append(os.path.join(root, filenames)) 
  12.             zip.extract()

Outcomes