Jason Tackaberry wrote:
> On Thu, 2006-04-20 at 14:24 +0200, Hans Meine wrote:
>> It's not an "issue to be solved", it's a features AFAIK.  I use that a lot 
>> (with Qt actually) as a poor man's (and hassle-free!) threading technique, 
>> to 
>> do calculations in the background.
>
> Python makes this kind of thing really easy too.  Just use a generator:
>
> def my_workhorse_func():
>    for i in somelist:
>       do_complicated_thing(i)
>       yield True
>    yield False
>
> kaa.signals["idle"].connect(my_workhorse_func)
>
> Instant cooperative multitasking :)

I think I have to take a look at 'yield'. Looks like a feature I
needed and solved in a different way. :)


Dischi

-- 
A day without sun shine is like, you know, night.

Attachment: pgpsOwoRppY35.pgp
Description: PGP signature

Reply via email to