title: Error 32, Python, file being used by another process
body: <p>I have a simple program, which looks for all compressed folders in a directory, targets one compressed file, gets an excel file located inside the compressed file and moves it to another location (it does this for every excel file, for how many ever compressed folders):</p>
  
  <pre><code>path = 'C:\Users\me\Documents\Extract'
  new_path = 'C:\Users\me\Documents\Test'
  i = 0
  for folder in os.listdir(path):
          path_to_folder = os.path.join(path, folder)
  
          zfile = zipfile.ZipFile(os.path.join(path, folder))
          for name in zfile.namelist():
              if name.endswith('.xls'):
                  new_name = str(i)+'_'+name
                  new_path = os.path.join(new_path, new_name)
                  zfile.close()
                  #os.rename(path_to_folde, new_path) -- ERROR HERE
                  shutil.move(path_to_folde, new_path) -- AND ERROR HERE
          i += 1
  </code></pre>
  
  <p>I have tried 2 ways to move the excel file <code>os.rename</code> and <code>shutil.move</code>. I keep on getting an error: </p>
  
  <blockquote>
    <p>WindowsError: [Error 32] The process cannot access the file beacause it is being used by another process.</p>
  </blockquote>
  
  <p>I don't understand why this error persists, since I have closed every folder.</p>