Maybe use logging package to "tee" the output to console and GUI.
Maybe use logging package to "tee" the output to console and GUI.