Mar-27-2021, 04:59 AM
(This post was last modified: Mar-27-2021, 05:00 AM by deanhystad.)
I guessed that since your answer doesn't work at all for the question in the original post. That's not surprising because what MLGpotato wants to do so is odd. He wants to write a function that creates a button, and then have code execution pause until the button is pressed.
It is like he wants to do this:
It is like he wants to do this:
def A(): print('Waiting for 10 seconds') time.sleep(10) print('Done sleeping')But with a button.
def A(): print('Push button after 10 seconds') tk.Button(root, text="Push Me", command=continue) print('Done sleeping')MLGpotato would like the code to pause right after the button is created, and continue when the button is pressed. As far as I know, that is impossible in tkinter. I can make something that looks like that is what happened, but it uses a completely different mechanism.