I do not have any code to show with this question because I am just seeking advice.  I have a functional piece of code and through the execution of which I create approx 20 - 30 unique panels.  I only use one at any given time (with a few small exceptions) and I use show/hide to manage which panels are displayed at a given time.
My question is this:  Is it best that I create all 30 panels at the inception point of the code, hide the 29 that are not needed and move on, and then show/hide between the 30 panels as the code runs, or should I only create the one or two that are needed at the start and create the others as they are called for and then hide/destroy the ones that have served their purpose.
There are a couple of approaches. The first is to just create all of the panels that you need and hide them as you've been doing. Another approach would be to create the sizers with the widgets laid out appropriately and just hide the sizers as needed. This way you would only ever have one or two panels, but different layouts.
wxpython create multiple panels at start or as the program progresses