If you want to create a text document that lists everything inside the .zip :
If you received this file in a text message or email claiming to be from DHL , please be cautious. Official DHL fraud awareness guidelines state they typically only request payments for customs via secure links and rarely send unsolicited .zip attachments, which are often used to spread malware. dhlen.zip
import zipfile with zipfile.ZipFile('dhlen.zip', 'r') as z: with z.open('filename.txt') as f: print(f.read().decode('utf-8')) Use code with caution. Copied to clipboard If you want to create a text document
You can use ZipArchive to read a specific entry like a Readme.txt into a string. dhlen.zip
KB WinZip: How to print the list of files in a Zip file to a text file