In reading the python documentation on embedding it would seem (from section 1.4) that you could expose your main window pointer to the python interpreter, thereby permitting a python script from creating a widget owned by the QMainWindow instance.

This keeps the Qt app as the driver for the script and should allow you to create external scripts that are basically nothing more than functions that the interpreter loads. Your previous approach seems to want to make the external python script the driver instead - basically not even using the embedded interpreter.

Is this not doable? You might be able to adapt the Qt Plugin architecture for this - your python interpreter loads the python script and returns a QObject pointer to the python class that implements the plugin interface. The interface functionality is exposed by your app to define the protocol for the conversation between the python script and the Qt app.