Python - Timing messages to be sent

You will have to learn how to use the threading module (or subprocess, although not preferred).

A hacky way to get out of learning threading would be to keep track of time in your script.

  1. Specify the rate of the timer, let’s say 10 seconds.
  2. Grab the initial time at the start of the script using the time module. (outside of any loop)
  3. Grab the current time inside the while loop.
  4. Test to see if (current_time - initial_time) is equal to or greater than the rate.
  5. If so, display the message and reset the initial time.

These are the Python 2.7.X docs for the modules I talked about:

Threading: https://docs.python.org/2.7/library/threading.html
Time: https://docs.python.org/2.7/library/time.html
Subprocess: https://docs.python.org/2.7/library/subprocess.html