Killing a running thread
Alexander Skwar
ASkwar at DigitalProjects.com
Thu May 2 10:40:16 EDT 2002
»Michael Gilfix« sagte am 2002-05-02 um 10:09:11 -0400 :
> In Python you need to break your loops up into chunks and check a
> have a threading.Event () object that you check if set. So something
> like:
>
> done = threading.Event ()
>
> line = file.readline ()
> while line and not done.isSet ():
> # do stuff
> line = file.readline ()
>
> Or..
>
> for line in file.xreadlines ():
> if done.isSet ():
> break
Yes, that's for the easy case of the readline loop. However, how could
I break up a file.write() or a map()?
Alexander Skwar
--
How to quote: http://learn.to/quote (german) http://quote.6x.to (english)
Homepage: http://www.iso-top.de | Jabber: askwar at a-message.de
iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 8 days 9 hours 39 minutes
More information about the Python-list
mailing list