to be more independentexample - spawns each of the four demo launchers as independent programs (processes)using the launchmodes module we wrote at the end of this works only because the demos were written as both importable classes and runnable scripts launching them here makes all their names __main__ when runbecause they are separatestand-alone programsthis in turn kicks off the main loop call at the bottom of each of their files example - pp \gui\tour\demoall-prg py "" demo classes run as independent program processescommand linesif one window is quit nowthe others will live onthere is no simple way to run all report calls here (though sockets and pipes could be used for ipc)and some launch schemes may drop child program stdout and disconnect parent/child""from tkinter import from pp launchmodes import portablelauncher demomodules ['demodlg''demoradio''democheck''demoscale'for demo in demomodulesportablelauncher(demodemo py')(see parallel system tools start as top-level programs root tk(root title('processes'label(roottext='multiple program democommand lines'bg='white'pack(root mainloop(make sure the pp directory' container is on your module search path ( pythonpathto run thisit imports an example module from different directory as figure - showsthe display generated by this script is similar to the prior oneall four demos come up in windows of their own this timethoughthese are truly independent programsif any one of the five windows here is quitthe others live on the demos even outlive their parentif the main window is closed on windowsin factthe shell window where this script is started becomes active again when the main window is closedeven though the spawned demos continue running we're reusing the demo code as programnot module tkinter tourpart