Does anyone know how to open a password protected zip file with python if the password is "123" and the file name is :
/tmp/alien-zip-2092.zip
And then also read the txt file inside it?
Does anyone know how to open a password protected zip file with python if the password is "123" and the file name is :
/tmp/alien-zip-2092.zip
And then also read the txt file inside it?
Here is one way to do it:
import zipfile
zip = zipfile.ZipFile('/tmp/alien-zip-2092.zip', 'r')
zip.setpassword(b"123")
zip.extractall('extract/folder')
zip.close()