sending signals to the calling function
Jaco Smuts
JSmuts at clover.co.za
Mon Jun 28 05:52:00 EDT 2004
Go for Tim's generator idea
Had to figure it out a while ago in order to avoid multiple threads or
overly complex scheduling.
It is a great tool to have in your toolbox,
also see:
http://www-106.ibm.com/developerworks/linux/library/l-pythrd.html
and
http://www-106.ibm.com/developerworks/library/l-pycon.html
jaco
Haim Ashkenazi <haim at babysnakes.org>
Sent by: python-list-bounces+jsmuts=clover.co.za at python.org
06/28/2004 11:31 AM
To: python-list at python.org
cc:
Subject: Re: sending signals to the calling function
On Mon, 28 Jun 2004 12:14:29 +0300, Haim Ashkenazi wrote:
> Hi
>
> I have a function that receive a list of files and creates a zip from
> these files. I want it to send signal to the calling function with the
> name of the file it currently compressing. is there a way to do this
> (without threads)?
Hi, again...
here's a more detailed description:
at the moment, the function looks like this:
def CreateZip(self):
bakFile = 'data_backup_NS.zip'
print "\nCompressing your data...\n"
myZip = zipfile.ZipFile(bakFile, 'w', zipfile.ZIP_DEFLATED)
for file in self.FinalList:
print "adding", file, "..."
# zip doesn't support unicode
if isinstance(file, unicode):
myZip.write(file.encode('mbcs')) #good for windows
else:
myZip.write(file)
myZip.close()
it works fine when called from a console application, but now I want it to
be called from a wxwindows gui also (and redirect the output to a
wxScrolledMessageDialog). if there isn't a way to "signal" the calling
function, is there a way to redirect the output of the function (it's
running on windows)?
thanx
--
Haim
--
http://mail.python.org/mailman/listinfo/python-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20040628/557fcbd8/attachment.html>
More information about the Python-list
mailing list