'Read text file from a password protected zip file using python
I am trying to read a text file inside a password protected zip file using zipFile module in python But I couldn't achieve it, I tried the following ways
with zipFile.ZipFile(zip_filename, mode='r') as zip_file:
zip_file.open(text_filename, mode= 'r', pwd=password)
it gives me an error "Bad password for the text file".
But I am sure that the password is correct and I am able to extract the text file inside the zip
using zipFile.extractall()
is there any way i can read the contents of the text file without extracting it?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
