On Mon, 02 Mar 2009 16:13:39 +, MRAB
wrote:
> zf = zipfile.ZipFile('Archive.zip')
> for name in zf.namelist():
> new_path = os.path.join(output_folder, name)
> data = zf.read(name)
> try:
> open(new_path, 'wb').write(data)
> except IOError:
> # Create i
En Mon, 02 Mar 2009 13:09:05 -0200, Luis Zarrabeitia
escribió:
Quoting MRAB :
Steven D'Aprano wrote:
>
You might want to specify an output folder (and the data might be binary
too):
zf = zipfile.ZipFile('Archive.zip')
for name in zf.namelist():
open(os.path.join(output_folder, name), 'wb
Luis Zarrabeitia wrote:
Quoting MRAB :
Steven D'Aprano wrote:
A quick and dirty solution would be something like this:
zf = zipfile.ZipFile('Archive.zip')
for name in zf.namelist():
open(name, 'w').write(zf.read(name))
You might want to specify an output folder (and the data might be bin
Quoting MRAB :
> Steven D'Aprano wrote:
> > A quick and dirty solution would be something like this:
> >
> > zf = zipfile.ZipFile('Archive.zip')
> > for name in zf.namelist():
> > open(name, 'w').write(zf.read(name))
> >
> You might want to specify an output folder (and the data might be bin
Steven D'Aprano wrote:
On Mon, 02 Mar 2009 01:00:54 -0500, David Lyon wrote:
It might seem a simple question.. but how does one programmaticaly unzip
a file in python?
A quick and dirty solution would be something like this:
zf = zipfile.ZipFile('Archive.zip')
for name in zf.namelist():
On Mon, 02 Mar 2009 01:00:54 -0500, David Lyon wrote:
> It might seem a simple question.. but how does one programmaticaly unzip
> a file in python?
A quick and dirty solution would be something like this:
zf = zipfile.ZipFile('Archive.zip')
for name in zf.namelist():
open(name, 'w').write(