Finding the currently selected tab of Ttk Notebook

You can get currently selected tab using the "current" keyword:

noteBook.index("current")

Check this website: https://docs.python.org/2/library/ttk.html#tab-identifiers 24.2.5.3. Tab Identifiers


You can retrieve the selected tab through select method. However, this method returns a tab_id which is not much useful as is. index convert it to the number of the selected tab.

>>> nb.select()
'.4299842480.4300630784'
>>> nb.index(nb.select())
2

Note that you coud also get more information about the selected tab using tab

>>> nb.tab(nb.select(), "text")
'mytab2'

You might look at Notebook reference documentation : http://docs.python.org/3/library/tkinter.ttk.html#notebook