Python Forum
Continue command in python tkinter?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Continue command in python tkinter?
#8
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:
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.
Reply


Messages In This Thread
Continue command in python tkinter? - by MLGpotato - Feb-24-2021, 04:37 PM
RE: Continue command in python tkinter? - by deanhystad - Mar-27-2021, 04:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  tkinter.TclError: can't invoke "canvas" command cybertooth 8 6,054 Feb-23-2023, 06:58 PM
Last Post: deanhystad
  [Tkinter] button command tkinter Heyjoe 6 5,236 Jul-30-2020, 07:06 PM
Last Post: deanhystad
  tkinter button not accessing the command when clicked jhf2 1 3,596 Nov-23-2019, 10:17 PM
Last Post: DT2000
  [Tkinter] Tkinter newly created button does not execute command ChipsSlave 7 6,329 Jul-25-2018, 01:01 AM
Last Post: JUANCARLOS

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020