Extract zip file from email attachment
gagsl-py2 at yahoo.com.ar
Fri Apr 6 06:51:47 CEST 2007
> resp = p.retr(msg_num)
> if resp.startswith('+OK'):
You don't have to check this; errors are transformed into exceptions.
> fileObj = StringIO.StringIO()
cStringIO is faster
> fileObj.write( part.get_payload() )
You have to reset the file pointer to the beginning: fileObj.seek(0),
else ZipFile will not be able to read the contents.
More information about the Python-list