stringio+tarfile (or better... zipfile)

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri Jul 3 23:50:12 EDT 2009


En Fri, 03 Jul 2009 17:14:22 -0300, superpollo <user at example.net> escribió:

> following the excellent suggestions received, i tried to adapt the  
> problem to zipfile, and i wrote this:
>
> zip = zipfile.ZipFile(zb , "w" , zipfile.ZIP_DEFLATED)
> for name , buffer in [nb1 , nb2]:
>      zip.writestr(name, buffer.getvalue()*1000)
> zip.close()
>
> it seems to me thaz zipfile has a simpler usability... any comments?

Maybe - but a zip and a tar file are not the same thing.

Now, if you want to say that there should be a common interfase to handle  
all those file formats like tar,zip,bz2: Yes, I agree.

-- 
Gabriel Genellina




More information about the Python-list mailing list