window tk(button(windowtext='go!'command=launchpack(window mainloop(the - unbuffered flag is crucial here again--without ityou won' see the text output window the gui will be blocked in the initial pipe input call indefinitely because the spawned program' standard output will be queued up in an in-memory buffer on the other handthis - unbuffered flag doesn' prevent blocking in the prior section' socket schemebecause that example resets streams to other objects after the spawned program startsmore on this in also remember that the buffering argument in os popen (and subprocess popencontrols buffering in the callernot in the spawned program- pertains to the latter the specter of blocking input calls either way we code themhoweverwhen the guis of example - and example - are run they become unresponsive for two seconds at time while they read data from the os popen pipe in factthey are just plain sluggish--window movesresizesredrawsraisesand so onare delayed for up to two secondsuntil the non-gui program sends data to the gui to make the pipe read call return perhaps worseif you press the "go!button twice in the second version of the guionly one window updates itself every two secondsbecause the gui is stuck in the second button press callback--it never exits the loop that reads from the pipe until the spawned non-gui gui coding techniques