<br><font size=2 face="sans-serif">Go for Tim's generator idea</font>
<br>
<br><font size=2 face="sans-serif">Had to figure it out a while ago
in order to avoid multiple threads or overly complex scheduling.</font>
<br>
<br><font size=2 face="sans-serif">It is a great tool to have in your toolbox,
</font>
<br>
<br><font size=2 face="sans-serif">also see:</font>
<br>
<br><font size=2 face="sans-serif">http://www-106.ibm.com/developerworks/linux/library/l-pythrd.html
</font>
<br><font size=2 face="sans-serif">and</font>
<br><font size=2 face="sans-serif">http://www-106.ibm.com/developerworks/library/l-pycon.html</font>
<br>
<br><font size=2 face="sans-serif">jaco</font>
<br>
<br>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Haim Ashkenazi <haim@babysnakes.org></b></font>
<br><font size=1 face="sans-serif">Sent by: python-list-bounces+jsmuts=clover.co.za@python.org</font>
<p><font size=1 face="sans-serif">06/28/2004 11:31 AM</font>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To:
python-list@python.org</font>
<br><font size=1 face="sans-serif"> cc:
</font>
<br><font size=1 face="sans-serif"> Subject:
Re: sending signals to the calling function</font></table>
<br>
<br>
<br><font size=2><tt>On Mon, 28 Jun 2004 12:14:29 +0300, Haim Ashkenazi
wrote:<br>
<br>
> Hi<br>
> <br>
> I have a function that receive a list of files and creates a zip from<br>
> these files. I want it to send signal to the calling function with
the<br>
> name of the file it currently compressing. is there a way to do this<br>
> (without threads)?<br>
Hi, again...<br>
<br>
here's a more detailed description:<br>
<br>
at the moment, the function looks like this:<br>
<br>
def CreateZip(self):<br>
bakFile = 'data_backup_NS.zip'<br>
<br>
print "\nCompressing your data...\n"<br>
myZip = zipfile.ZipFile(bakFile, 'w', zipfile.ZIP_DEFLATED)<br>
<br>
for file in self.FinalList:<br>
print "adding", file, "..."<br>
# zip doesn't support unicode<br>
if isinstance(file, unicode):<br>
myZip.write(file.encode('mbcs')) #good for windows<br>
else:<br>
myZip.write(file)<br>
<br>
myZip.close()<br>
<br>
it works fine when called from a console application, but now I want it
to<br>
be called from a wxwindows gui also (and redirect the output to a<br>
wxScrolledMessageDialog). if there isn't a way to "signal" the
calling<br>
function, is there a way to redirect the output of the function (it's<br>
running on windows)?<br>
<br>
thanx<br>
-- <br>
Haim<br>
<br>
<br>
<br>
-- <br>
http://mail.python.org/mailman/listinfo/python-list<br>
</tt></font>
<br>