Maybe this helps:<br><a href="http://www.python.org/doc/2.5/tut/node13.html#SECTION0013400000000000000000">http://www.python.org/doc/2.5/tut/node13.html#SECTION0013400000000000000000</a><br>It's a multi threading example using zipfile and threading modules<br>
<br><div class="gmail_quote">On Tue, Nov 18, 2008 at 5:46 PM, Nolan Hughes <span dir="ltr"><<a href="mailto:nolan.e.hughes@gmail.com">nolan.e.hughes@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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.<br>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:<br>
<br>myZip = zipfile.ZipFile(file_name, 'w')<br>try:<br> for a_file in file_list:<br> myZip.write(a_file)<br>finally:<br> myZip.close()<br><br># zip handling instructions<br>shutil.copy(file_name, journal_location)<br>
# ... put the zip file in the journal ...<br>....<br><br>What can we do to have this work?<br><br>Thanks,<br><font color="#888888"><br>Nolan<br><br><br>
</font><br>_______________________________________________<br>
Sugar mailing list<br>
<a href="mailto:Sugar@lists.laptop.org">Sugar@lists.laptop.org</a><br>
<a href="http://lists.laptop.org/listinfo/sugar" target="_blank">http://lists.laptop.org/listinfo/sugar</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Emiliano Pastorino<br>LATU - Plan Ceibal<br>Av. Italia 6201 CP: 11500, Montevideo, Uruguay<br>Tel: (598 2) 601 3724 int.: 469<br>