Servando Garcia wrote:
> Hello list
> How do I read the comments attached to a zipfile or for any
> file .?
For a zipfile, you can open the file with the zipfile module. Each file in the
zip has a ZipInfo
object associated with it. You get a single ZipInfo using getinfo(name) on the
opened ZipFile, or
get a list of all ZipInfos with infolist().
>>> import zipfile
>>> zip = zipfile.ZipFile('myfile.zip')
>>> i = zip.getinfo('afile.txt')
>>> i.comment
'*'
Kent
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor