I have a python script that I would like to run between 9 am and 4 pm everyday, but there's also a part of the same script that I'd like to run every 10 seconds during this time. How would I go about in doing this? I have looked at datetime modules, but I did not come across examples where they compare times and schedule an event. Also there seems to be some difference with the datetime module in Python 2.7 and 3.x. I am using Python 2.7. Could someone help me with this or direct me to the right sources? Thank you.
Asked
Active
Viewed 967 times
0
-
2Possible duplicate of [How do I get a Cron like scheduler in Python?](http://stackoverflow.com/questions/373335/how-do-i-get-a-cron-like-scheduler-in-python) – Jezor Aug 29 '16 at 01:21
-
1You could also use normal `cron` and schedule it every 10 sec but use Python date tools to detect if it was during the day and only run certain functionality. – Two-Bit Alchemist Aug 29 '16 at 01:24