On Tuesday 02 Jul 2002 11:03 am, Paul Winkler wrote:
If by "executing" you mean "running a loop indefinitely", maybe you could do something like (untested)
- make a Product by copying the "Boring" product
- in Boring.py (or whatever you call it), add this to the end of __init__():
import time delay_seconds = 1 while 1: # your code goes here time.sleep(delay_seconds)
- Add an instance of this product somewhere in your zope tree.
Your code should then start running sometime before Zope finishes starting up, and will run as long as Zope is up.
With that code, Zope will never finish starting up :-) You need to run that code in its own thread, with the appropriate magic to use yor own ZODB transaction. Take a look at the Xron product, which does exactly this.