Is there a way to press a button without touching it on tkinter / python?

button, python, tkinter, user-interface

Solution

As Joel Cornett suggests in a comment, it might make more sense to simply call the callback that you passed to the button. However, as described in the docs, the `Button.invoke()` method will have the same effect as pressing the button (and will return the result of the callback), with the slight advantage that it will have no effect if the button is currently disabled or has no callback.

Problem

Hi I need to do this because, I am making a matching / memmory game, and there has to be a button (Totally separated from the ones on the current game) that when I press it, it has to show the matching cards automatically without having to touch the buttons with the mouse. Is there a "press" function or something like that for pressing the button? Thanks! :)

Original source