Evaluating a Function After X Seconds: Python Equivalent to JavaScript's SetTimeout() Function

KenAggie kewashi at gmail.com
Sun Jun 11 23:50:31 EDT 2006


Yea -- the "sched" class is exactly what you need. Just import sched
and then use it to schedule a function call in the future, either using
relative time or an absolute time. The python help file tells you how
in detail.
  - Ken

ycoci0 at gmail.com wrote:
> Hi all,
>
> Not exactly new to Python, just have not programmed a time dependent
> function using it before.
>
> I imagine that many of you may also program some JavaScript and may be
> familiar with JavaScript's SetTimeout( expression, after time interval
> in milliseconds) function.  Does Python have an equivalent to this?
>
> A SetTimeout-like Python function would be ideal for my application.
> 
> 
> Best,
> 
> Y-coci




More information about the Python-list mailing list