although guioutput takes care to call tkinter' update method to update the display after each line is writtenthis module has no control in general over the duration of functions or shell commands it runs in redirectedguishellcmdfor examplethe call to input readline will pause until an output line is received from the spawned programrendering the gui unresponsive because the output object runs an update callthe display is still updated during the program' execution (an update call enters the tk event loop momentarily)but only as often as lines are received from the spawned program in additionbecause of this function' loopthe gui is committed to the shell command in general until it exits calls to redirected function in redirectedguifunc are similarly blocking in generalmoreoverduring the call' duration the display is updated only as often as the function issues output requests in other wordsthis blocking model is simplistic and might be an issue in larger gui we'll revisit this later in the when we meet threads for nowthe code suits our present purpose using redirection for the packing scripts nowfinallyto use such redirection tools to map command-line script output back to guiwe simply run calls and command lines with the two redirected functions in this module example - shows one way to wrap the packing operation dialog of the shell gui section' example - to force its printed output to appear in popup window when generatedinstead of in the console example - pp \gui\shellgui\packdlg-redirect py wrap command-line script in gui redirection tool to pop up its output from tkinter import from packdlg import runpackdialog from pp gui tools guistreams import redirectedguifunc def runpackdialog_wrapped()redirectedguifunc(runpackdialogcallback to run in mytools py wrap entire callback handler if __name__ ='__main__'root tk(button(roottext='pop'command=runpackdialog_wrappedpack(fill=xroot mainloop(you can run this script directly to test its effectwithout bringing up the shellgui window figure - shows the resulting stdout window after the pack input dialog is dismissed this window pops up as soon as script output is generatedand it is bit more gui user friendly than hunting for messages in console you can similarly code the unpack parameters dialog to route its output to pop-up simply change guistreamsredirecting streams to widgets