The Python Oracle

What is the best way to repeatedly execute a function every x seconds?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Secret Catacombs

--

Chapters
00:00 Question
00:47 Accepted answer (Score 374)
01:28 Answer 2 (Score 346)
01:44 Answer 3 (Score 104)
03:25 Answer 4 (Score 86)
04:03 Thank you

--

Full question
https://stackoverflow.com/questions/4745...

Question links:
[NSTimer]: http://web.archive.org/web/2009082301270...
[this question about a cron implemented in Python]: https://stackoverflow.com/questions/3733...
[sleep()]: http://docs.python.org/library/time.html...

Accepted answer links:
[sched]: http://docs.python.org/library/sched.htm...

Answer 4 links:
[Twisted]: http://twistedmatrix.com/trac/
[Reactor Pattern]: http://en.wikipedia.org/wiki/Reactor_pat...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #timer

#avk47