[Python-ideas] Improve of threading.Timer

2019-06-08 Thread killerrex
Hi, I recently needed to run a function every half a second and the first option was threading.Timer, but it just tick once. Based on https://stackoverflow.com/a/48741004 I derived a class from Timer to run endlessly, but there are two things I do not like: - The function, args and kwargs attrib

[Python-ideas] Re: Improve of threading.Timer

2019-06-08 Thread Ronie Martinez
Event scheduler library already exists and can be "tweaked" to become periodic. - https://docs.python.org/3/library/sched.html Best Regards, Ronie On Sun, Jun 9, 2019, 2:35 AM wrote: > Hi, > > I recently needed to run a function every half a second and the first > option was threading.Timer, bu

[Python-ideas] Re: Improve of threading.Timer

2019-06-08 Thread Andrés Ayala
Thanks for the hint, although using sched it is more complex for just one background activity, the priority part solves many problems with 2 or more activities in parallel. I managed to create a task with equivalent functionality using an action that re-schedules itself each time is called... t