Hi Mike, I'm curious to know where is this "main() for Pyramid" you were referring to?
Thanks. Jerry On Jun 30, 5:30 am, Mike Orr <[email protected]> wrote: > On Wed, Jun 29, 2011 at 10:40 AM, hisan <[email protected]> wrote: > > how to call a function for evry 10 secs in python > > I assume this is a Pylons or Pyramid application since this is > pylons-discuss. The easiest way would probably be to start a thread in > the initialization code (environment.py for Pylons, main() for > Pyramid). The thread would run a long-running function with a loop > that that records its start time, does its thing, sleeps for ``(10 > seconds - (now - start_time))``, and repeats. > > Another way to do repeated events is with cron, possibly using "paster > request". But that won't work in this case because cron can't handle > intervals of less than a minute. > > -- > Mike Orr <[email protected]> -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
