I think I mostly understand the symptoms you're describing now.  I don't know why they are happening, though. :(

I don't use Geany very often, and my installation is pretty old, I think.  But when I execute a Python script in Geany using F5, my cmd.exe window actually contains all the output, whether it's "normal" output (from print statements) or error output (exception tracebacks), so I get a chance to read everything before I press the key to close cmd.exe.  I don't get a separate python.exe window at all.

When you have an error and your python.exe window goes away very quickly, that's just like what happens if you double-click the script in the Windows graphical environment.

I don't know how to fix your problem, but until someone more knowledgeable than I am can give you an answer, I at least can suggest a workaround:  Open a command window manually (not from Geany), and run your Python script from there.

John Y.