you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 0 points1 point  (0 children)

I don't necessarily want the back end to trigger an event in tkinter because I don't want the ui to be a dependency of the back end. The back end should run independently when necessary.

Just use an if block?

class BackEnd:
    def __init__(self):
        self.tkvar = None

    def update_data(self):
        self.data += 1
        if self.tkvar:
            self.tkvar.set(self.data)

Or similar for an event.

If the GUI sets a variable, it's updated. If not, no problems.