it implements an abstract superclasslaunchmodewhich defines what it means to start python program named by shell command linebut it doesn' define how insteadits subclasses provide run method that actually starts python program according to given scheme and (optionallydefine an announce method to display program' name at startup time example - pp \launchmodes py ""##################################################################################launch python programs with command lines and reusable launcher scheme classesauto inserts "pythonand/or path to python executable at front of command linesome of this module may assume 'pythonis on your system path (see launcher py)subprocess module would work toobut os popen(uses it internallyand the goal is to start program running independently herenot to connect to its streamsmultiprocessing module also is an optionbut this is command-linesnot functionsdoesn' make sense to start process which would just do one of the options herenew in this editionruns script filename path through normpath(to change any to for windows tools where requiredfix is inherited by pyedit and otherson windowsis generally allowed for file opensbut not by all launcher tools##################################################################################""import sysos pyfile (sys platform[: ='winand 'python exe'or 'pythonpypath sys executable use sys in newer pys def fixwindowspath(cmdline)""change all to in script filename path at front of cmdlineused only by classes which run tools that require this on windowson other platformsthis does not hurt ( os system on unix)""splitline cmdline lstrip(split('split on spaces fixedpath os path normpath(splitline[ ]fix forward slashes return join([fixedpathsplitline[ :]put it back together class launchmode""on call to instanceannounce label and run commandsubclasses format command lines as required in run()command should begin with name of the python script file to runand not with "pythonor its full path""def __init__(selflabelcommand)self what label self where command def __call__(self)on callexbutton press callback self announce(self whatself run(self wheresubclasses must define run(def announce(selftext)subclasses may redefine announce( parallel system tools