Forum Archive

using zipfile is a problem for me

PKHG

Hi,
I have a zipfile at /Documents/testwww_resources/smokes.zip
How to show the content, how to see if it is empty or not?
stash shows it ...
got from
https://github.com/tjferry14/Cloud-Jump-2 trying to use see other thread with other problem

dgelessus

Pythonista can extract ZIP files natively - tap on the ZIP file to open it in the editor, then tap on "Extract Archive...". You can also use Stash's unzip command, or Python's zipfile module (specifically the extractall method of a ZipFile object).

If you want to see what files are in a ZIP file without extracting it fully, you can use the namelist or infolist methods of a ZipFile object. Stash's unzip also supports a -t option to list a ZIP file instead of extracting it, but this doesn't work well if the ZIP file contains folders - unzip -t will only print out the names of all files, but not the names of the folders that they are in.

PeterG

Thanks ,
Stupid Peter, was not aware that searching if contents like site-packages are visible I can search for the directory and tap there on the zip file , etc, in stash indeed the unzip -t zipfilenamezip works very nice
Thanks helping a again Pyhonista user (first uses several years ago and than not using it)
Peter

dgelessus

@PeterG You're welcome :) (Are you the same person as @PKHG?)

Phuket2

@PKHG, I have the same question as @dgelessus . Its a little confusing. It appears you are writing questions with one id and answering with another id. Not saying its bad, just confusing

PeterG

Yes PeterG and PKHG are the same. Asking as PKHG for the forgotton password did not work 2-3 times, therfore a new account...