[Tkinter-discuss] (no subject)

Vasilis Vlachoudis Vasilis.Vlachoudis at cern.ch
Wed Mar 4 10:33:07 EST 2020


I had the impression that tkinter is single threaded, but it seems that the breakpoint() or input()
does not block the mainloop to continue
If one clicks the second button that waits for an input or enter in the breakpoint()
the mainloop is still responsive while it waits for an input. So one can click any button
the first to display the message or the second that will abort with a message that readline cannot
be re-entered?

Why is that? What other commands can trigger such a behavior?

import tkinter as tk

def boinc():
for i in range(10):
print("boinc...")

def debug():
#breakpoint()
print("Breakpoint")
print("Input: ",end="")
s = input()
print("Entered:", s)

#-------------------------------------------------------------------------------
if __name__ == "__main__":
root = tk.Tk()
b = tk.Button(root, text="Boinc", command=boinc)
b.pack()
b = tk.Button(root, text="Debug", command=debug)
b.pack()
root.mainloop()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20200304/44082127/attachment.html>


More information about the Tkinter-discuss mailing list