[sugar] Python Zip Library

Emiliano Pastorino epastorino at plan.ceibal.edu.uy
Wed Nov 19 06:57:18 EST 2008


Maybe this helps:
http://www.python.org/doc/2.5/tut/node13.html#SECTION0013400000000000000000
It's a multi threading example using zipfile and threading modules

On Tue, Nov 18, 2008 at 5:46 PM, Nolan Hughes <nolan.e.hughes at gmail.com>wrote:

> I'm part of team developing the Bundle Activity which will handle zip (and
> other) archives and have run into a problem with the Zip library in Python.
> We are currently trying to zip a list of files, and then have the program
> perform other operations with the resulting zip file. The problem is that
> Python seems to run asynchronously, so the program execution skips the zip
> file completion and goes on to the next instructions (which is NOT what we
> want). In other words, the instructions that handle the resulting zip file
> get run before the zip file is completely finished. Our code looks like:
>
> myZip = zipfile.ZipFile(file_name, 'w')
> try:
>    for a_file in file_list:
>      myZip.write(a_file)
> finally:
>   myZip.close()
>
> # zip handling instructions
> shutil.copy(file_name, journal_location)
> # ... put the zip file in the journal ...
> ....
>
> What can we do to have this work?
>
> Thanks,
>
> Nolan
>
>
>
> _______________________________________________
> Sugar mailing list
> Sugar at lists.laptop.org
> http://lists.laptop.org/listinfo/sugar
>
>


-- 
Emiliano Pastorino
LATU - Plan Ceibal
Av. Italia 6201 CP: 11500, Montevideo, Uruguay
Tel: (598 2) 601 3724 int.: 469
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.laptop.org/pipermail/sugar/attachments/20081119/543f5cdf/attachment.htm 


More information about the Sugar mailing list