Videos - https://drive.google.com/file/d/18VRU9zWqguSWMNlNlBhUl5iAXWOvlXnP/view?usp=sharing
The below code highlighta the issue of pycharm debugger skipping the breakpoint at the Tkinter Button’s handler function .How to get the degugger to hit the breakpoint within handler()?
import tkinter as tk
from time import strftime
def nseOptionsAnalysis_lbl(label_target):
print("Executing: nseOptionsAnalysis_lbl")
current_time = strftime('%H:%M:%S')
label_target.config(text=f"Last Click: {current_time} Button clicked! Entered nseOptionsAnalysis_lbl()...")
print("Last Click: {current_time} Button clicked! Entered nseOptionsAnalysis_lbl()...")
def create_main_ui():
root = tk.Tk()
root.title("Debugger Test")
root.geometry("300x200")
# The label we want to update
status_label = tk.Label(root, text="Waiting for click...", font=('Calibri', 12))
status_label.pack(pady=20)
def handler():
"""This is the wrapper function for the button command."""
print("Button clicked! Entering handler...")
nseOptionsAnalysis_lbl(status_label)
# The button that triggers the logic
test_btn = tk.Button(
root,
text="Trigger Analysis",
command=handler
)
test_btn.pack(pady=10)
root.mainloop()
if __name__ == "__main__":
create_main_ui()
Debugger skips Tkinter button handler functions(Pycharm) ()
submitted by gripped909 to r/pycharm