Problem while trying to extract a directory from a zipfile.
vincent at visualtrans.de
Wed Dec 8 18:04:01 CET 2004
> I have this code:
> file = zipfile.ZipFile(nome_arquivo)
> Gauge.start() #inicia o Gauge
> for element in file.namelist():
> newFile = open(diretorio + element,"wb")
> newFile = open(diretorio + element + '/',"w")
> # Gauge
> percent = percent + 10
> Gauge.set_text("Extraindo" + element)
> # Extrai
> But when i try to extract an zipfile with a directory in it the code
> returns me an IOErro exception: "It is a directory"
> Please how can i solve it ?
You need to create any directories yourself. Maybe
the recipe at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252508
gives you some ideas on how.
More information about the Python-list