@potholiday I pointed to the Python documentation because AFAICT there is no way of making Python do what you want.
And as I pointed out, Geany knows about talking to a bash shell, not a Python shell, since a bash shell is language independent and Geany is a multi-language tool, not just a Python tool.
There are times when I forgot to start python shell and send the whole code to terminal Alt+Shift+F5 it then hangs Geany.
Yes I can imagine a Python program would give bash indigestion :) but it shouldn't hang all of Geany, just the run part until bash returns.