Timed method in Python
<p>How do I have a part of python script(only a method, the whole script runs in 24/7) run everyday at a set-time, exactly at every 20th minutes? Like 12:20, 12:40, 13:00 in every hour.</p>

<p>I can not use cron, I tried periodic execution but that is not as accurate as I would... It depends from the script starting time.</p>

<p>Use for example redis for that and <a href="https://github.com/ui/rq-scheduler" rel="nofollow">rq-scheduler</a> package. You can schedule tasks with specific time. So you can run first script, save to the variable starting time, calculate starting time + 20 mins and if your current script will end, at the end you will push another, the same task with proper time.</p>

python