0

I have some 100 folders zipped and password protected. To unzip them using python script I can use:

import zipfile
with zipfile.ZipFile("file.zip","r") as zip_ref:
    zip_ref.extractall("targetdir").

But how to give password. Suppose the password is 'password'. How van i unzip and print all the folders using python script.

Jean-François Fabre
  • 131,796
  • 23
  • 122
  • 195
Sapna
  • 1
  • 1
  • 3

1 Answers1

-1

Well , according to the documentation, just add the password in your code.

ZipFile.extractall([path[, members[, pwd]]])

Source: https://docs.python.org/2/library/zipfile.html

tglaria
  • 5,338
  • 2
  • 12
  • 17