Killing a running thread

Aahz aahz at pythoncraft.com
Thu May 2 21:39:18 EDT 2002


In article <m38z724d46.fsf at mira.informatik.hu-berlin.de>,
Martin v. Loewis <martin at v.loewis.de> wrote:
>Alexander Skwar <ASkwar at DigitalProjects.com> writes:
>>
>> Yes, that's for the easy case of the readline loop.  However, how could
>> I break up a file.write() or a map()?
>
>For a map call, you need to check inside the callback function for a
>flag. There is no way to get out of a file.write; you may try to use a
>non-blocking write operation.

I'd suggest that if you're expecting to break out of map() this way,
you're probably better off coding the map() as an explicit loop.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I used to have a .sig but I found it impossible to please everyone..."  --SFJ



More information about the Python-list mailing list