If not running the Pythonista 3 beta, you can get periodic updates with the code below.
This is not my idea, I just simplified an idea in the TimedRefreshView.py example program, written by cclauss, that I found at:
My program, named "say_random_digit.py", says a random digit from 0 to 9 every 5 seconds.
I had to change the data member "self.update_interval" to "self.updatex_interval" and the method "update" to "updatex" so as not to conflict with the names in the Pythonista 3 beta, which I am currently running.
I like having this functionality built into the ui.View class much more than having to implement it, so I look forward to the beta becoming the released product.
from random import randint
""" This class contains a method named updatex, which is periodically called. """
self.updatex_interval = 5
""" Say a random digit from 0 to 9 every 5 seconds. """
speech.say('%s' % (randint(0, 9)))
""" This method calls the updatex method periodically """
update_thread = threading.Timer(self.updatex_interval,
if __name__ == "__main__":
v = TimedUpdateView()