Occasionally I’ll see someone on the wxPython users group ask about how to make the wx.Notebook change pages (or tabs) programmatically. So I decided it was about time I figured it out. Here is some code that works for me:

The main thing to know is that you need to use SetSelection (or ChangeSelection) to force the Notebook widget to change pages. That’s it! This code was tested on Windows 7 with Python 2.7.3 and wxPython 2.9.3.1 (Classic). See also this discussion on Nabble.