Co-routines

Bengt Richter bokr at oz.net
Fri Jul 18 23:40:20 CEST 2003


On Fri, 18 Jul 2003 14:57:35 +0000 (UTC), Duncan Booth <duncan at NOSPAMrcp.co.uk> wrote:

><thewrights at ozemail.com.au> wrote in
>news:g7xRa.305$fF.9914 at nnrp1.ozemail.com.au: 
>
>> I have an application in which I want the users to be able to create
>> python functions:
>> 
>> def f1():
>>     print "1-1"
>>     print "1-2"
>>     print "1-3"
>> 
>> def f2():
>>     print "2-1"
>>     print "2-2"
>>     print "3-3"
>> 
>> and when my application runs, I want to execute these functions in
>> "lock-step", so that the output looks like:
>> 
[...]
>
[...]
>----- begin steplock.py -----
># Execute functions in steplock
[...]
>if __name__=='__main__':
>    test()
>----- end steplock.py -----
>
>-- 
>Duncan Booth                                             duncan at rcp.co.uk
>int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
>"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?

OP:
From: <thewrights at ozemail.com.au>
Newsgroups: comp.lang.python
Subject: Co-routines
Lines: 63
Date: Thu, 17 Jul 2003 23:07:36 +1000

SOLUTION:
From: Duncan Booth <duncan at NOSPAMrcp.co.uk>
Newsgroups: comp.lang.python
Subject: Re: Co-routines
Date: Fri, 18 Jul 2003 14:57:35 +0000 (UTC)
Organization: RCP Consultants
Lines: 248

Ok, I'm impressed ;-)

Regards,
Bengt Richter




More information about the Python-list mailing list