Re: freeze function calls

2010-08-11 Thread Santiago Caracol
Peter, thanks again for all this code. You helped me a lot. > Didn't you say you weren't interested in the web specific aspects? I thought that, although my problem had to do with client-server stuff, it wasn't really web-specific. But now I think that that was part of my problem. I failed to se

Re: freeze function calls

2010-08-10 Thread Peter Otten
Santiago Caracol wrote: >> Run the above with >> >> $ python wsgi_demo.py >> Serving on port 8000... >> > > Thanks a lot for this code. The problem with it is that the whole > application IS a generator function. That means that if I run the code > at, say foo.org, then any user that visits the s

Re: freeze function calls

2010-08-10 Thread Santiago Caracol
> Run the above with > > $ python wsgi_demo.py > Serving on port 8000... > Thanks a lot for this code. The problem with it is that the whole application IS a generator function. That means that if I run the code at, say foo.org, then any user that visits the site will augment the answer number of

Re: freeze function calls

2010-08-10 Thread Peter Otten
Santiago Caracol wrote: >> Python offers an elegant mechanism to calculate values on demand: the >> generator function: >> >> >>> def calculate_answers(): >> >> ... for i in range(100): >> ... print "calculating answer #%d" % i >> ... yield i * i >> ... >> > > Thanks f

Re: freeze function calls

2010-08-10 Thread Santiago Caracol
> Python offers an elegant mechanism to calculate values on demand: the > generator function: > > >>> def calculate_answers(): > > ...     for i in range(100): > ...             print "calculating answer #%d" % i > ...             yield i * i > ... > Thanks for pointing this out. I was aware of th

Re: freeze function calls

2010-08-10 Thread Peter Otten
gets a -signal within a reasonable period > of time, it goes on producing more answers exactly at the point at > which it got frozen. If no signal is sent, the function call is > terminated automatically after > M seconds. > > Note that, although the program to be written is a w