I want to periodically update a text window with the current time at a rate of about 1 sec. Can't figure out how to periodically get time and update text window. put a loop both before and after mainloop(). neither work.
# Siderial Time Calculation
from Tkinter import *
import time as tm
from time import strftime
from PyAstronomy import pyasl
import datetime
root = Tk()
st=strftime("%a, %d %b %Y %H:%M:%S +0000 %Z", tm.gmtime())
print 'st',st[17:25]
mytext = Text(root, background='#101010', foreground="#D6D6D6", borderwidth=18, relief='sunken',width=16, height=5 )
mytext.insert(END, st)
mytext.grid(row=0, column=0, columnspan=6, padx=5, pady=5)
root.mainloop()
With infinite loop before mainloop Text widget does not appear. With infinite loop after mainloop widget appears but no text window update.