"Rob Andrews" <[EMAIL PROTECTED]> wrote

>> Is there a method in Python which does what
>> setInterval('someFunction()',5000) does in Javascript.
>>
>> Basically, I want to call functionOne() every x minutes, and 
>> wondering
>> whats the best way to do it.
>
> Yes, the time module in the standard library has sleep(x), where x 
> is
> in seconds.

Unfortunately sleep blocks the program so you may need to wrap it
in a thread to launch the required function at the required time
without blocking the main program.

There probably is a third party module that will do this but I don't
know of any.

If its within a GUI context then I think both Tkinter and wxPython
have timer facilities although I've never used them.

Alan G. 


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to