I have a function bound to the left mouse button that creates a piece on a playing board. In the end of that function, I call another function that creates another piece placed by the computer. I want this to be delayed, but so far I have not been able to do it.
I tried using "after" when I call the second function in the end of the first function, but that delays the initial function too, so both pieces are placed after the set time instead of one instantly, and then the other after a delay.
Edit: Tried this, but still the same issue. Is something wrong with this piece of code?
def onClick(self, event):
self.newMove(event)
self.gui.after(2000, self.AI())
So my question is basically how this could be solved in a neat way.