I have a wx.Frame that has only a single child. While setting up the child's wx.Sizer, I can use the wx.SHAPED flag, which keeps the aspect ratio of the child locked. However, the Frame still has complete freedom in it's aspect ratio, and will leave a blank space in the area that is left unused by the child.
How can I lock the aspect ratio of the wx.Frame during resizing?
Sizers cannot be applied to top-level windows (in order to define properties of the windows themselves as opposed to their contents), so unfortunately there is no "true" way to lock in the aspect ratio. Your best bet would be to catch your window's OnSize event, get the size that the user wants the window to be (which is stored in the wxSizeEvent), calculate the new width and height according to the aspect ratio and then immediately call SetSize with the new size. 
This technique has the drawback of visual artifacts during resizing (the operating system will initially paint the window according to how the user has dragged it but then immediately redraw it after you call SetSize, leading to a flickering effect) so it isn't a great solution, however since you cannot lock top-level windows into aspect ratios (and prevent the need to resize with SetSize at all) you'll have to decide whether the flickering is worth it.
wxwidgets/wxPython: Resizing a wxFrame while keeping aspect ratio