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 – Open tab via code

We can select a notebook tab through code using the .select() method and passing in the index number for the tab we want to open.

img

1
2
# Select the second tab.
my_notebook.select(tab_id=1)

Tab index numbers start from 0 (zero).