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).