from multiprocessing import process demomodules ['demodlg''demoradio''democheck''demoscale'def rundemo(modname)module __import__(modnamemodule demo(mainloop(run in new process build gui from scratch if __name__ ='__main__'for modname in demomodulesprocess(target=rundemoargs=(modname,)start(in __main__ onlyroot tk(parent process gui root title('processes'label(roottext='multiple program demomultiprocessing'bg='white'pack(root mainloop(operationallythis version differs on windows only in thatthe child processesstandard output shows up in the window where the script was launchedincluding the outputs of both dialog demos themselves and all demo windowsstate buttons the script doesn' truly exit if any children are still runningthe shell where it is launched is blocked if the main process' window is closed while children are still runningunless we set the child processesdaemon flag to true before they start as we saw in --in which case all child programs are automatically shut down when their parent is (but parents may still outlive their childrenalso observe how we start simple named function in the new process as we learned in the target must be pickleable on windows (which essentially means importable)so we cannot use lambdas to pass extra data in the way we typically could in tkinter callbacks the following coding alternatives both fail with errors on windowsprocess(target=(lambdarundemo(modname))start(these both failprocess(target=(lambda__import__(modnamedemo(mainloop())start(we won' recode our gui program launcher script with any of the other techniques availablebut feel free to experiment on your own using as resource although not universally applicablethe whole point of tools like the portablelauncher class is to hide such details so we can largely forget them cross-program communication spawning guis as programs is the ultimate in code independencebut it makes the lines of communication between components more complex for instancebecause the demos run as programs herethere is no easy way to run all their report methods from the launching script' window pictured in the upper right of figure - in factthe tkinter tourpart