How do I run a python script between two times?
<p>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. </p>

<p>If you are using Linux,you should read <a href="http://kvz.io/blog/2007/07/29/schedule-tasks-on-linux-using-crontab/" rel="nofollow">crontab</a>,it is a powerful tool to help you with schedule.<br>
On the other hand,in Python2.7 ,try <a href="https://docs.python.org/2/library/sched.html" rel="nofollow">sched</a> to schedule a repeating event .</p>

<p>Hope this helps.</p>

python python-2.7 datetime