Generally, you would store the next time you want to execute, i.e. now+10 seconds,
using a loop,
call the function,
upon the return get the time and calculate the difference between it and the next time and sleep that amount of time,
update the next time, (+10 seconds), and loop again.
Also, Python has a schedule module, as do most operating systems. On Linux you can use cron to execute the program every 10 seconds, if you want to continue forever.
You can always use the threading module for scheduling such functions trivially. I.e.
def worker(self, name):
# check if we need to exit
while not self._exitflag:
# perform jobs
Though when you .join() the function, you will need to wait for the time specified in your self._nap_time variable.
I am working creating a fully encapsulated, homogeneous singly linked data structure. The Listing class and SinglyLinkedList class that are part of the whole application compile fine, but the problem ...