from ipywidgets import widgets
import ipdb
# Create a DatePicker widget
dp = widgets.DatePicker(
description='Pick a Date',
disabled=False
)
# Display the widget
display(dp)
# A button to signal completion of date selection
button = widgets.Button(description="I'm done picking a date")
display(button)
def on_button_clicked(b):
ipdb.set_trace()
print(f'Date selected: {dp.value}')
button.on_click(on_button_clicked)
I'm attempting to debug the above code in a jupyter notebook in VS Code.
I am expecting the debugger to stop at the line containing ipdb.set_trace() after I press the "I'm done picking a date" button . However, after I press the button the code stops running and the output produced is below