I have a TKinter GUI that interacts with an outside program by writing data to it and reading data from it over a UDP connection. The external program sends a status message at 1Hz, and I would like to have a looping callback within my TKinter class that receives that data, but I'm not quite sure how this is done. In a simplified form, here's what I have:
class App:
def __init__(self,master):
# Code that creates all the gui buttons, scales, etc
def SendValues(self,event):
# Code that sends the values of all the scales upon a button press
def ReceiveValues(self):
# Code that receives UDP data and then sets Tkinter variables accordingly
I want to have the ReceiveValues method execute once per second. How do I do this without interrupting all the other Tkinter events that could be happening?
Thanks!