I don't have ads on this website.
Donations help keep this site going.

If you find tkinter-snippets.com useful, please donate any amount you feel comfortable with.
Visit https://ko-fi.com/jobinpy to donate. Thank you!

ttk.Notebook – Get active tab

We can find out which tab is open and active in a notebook widget.

img

1
2
3
4
# Get the selected tab index number.
selected_tab_index = my_notebook.index("current")

print(selected_tab_index)