methods instead of if/elif logic def run(selfcmdline)assert false'run must be definedclass system(launchmode)""run python script named in shell command line caveatmay block callerunless added on unix ""def run(selfcmdline)cmdline fixwindowspath(cmdlineos system('% % (pypathcmdline)class popen(launchmode)""run shell command line in new process caveatmay block callersince pipe closed too soon ""def run(selfcmdline)cmdline fixwindowspath(cmdlineos popen(pypath cmdlineassume nothing to be read class fork(launchmode)""run command in explicitly created new process for unix-like systems onlyincluding cygwin ""def run(selfcmdline)assert hasattr(os'fork'cmdline cmdline split(if os fork(= os execvp(pypath[pyfilecmdlineconvert string to list start new child process run new program in child class start(launchmode)""run command independent of caller for windows onlyuses filename associations ""def run(selfcmdline)assert sys platform[: ='wincmdline fixwindowspath(cmdlineos startfile(cmdlineclass startargs(launchmode)""for windows onlyargs may require real start forward slashes are okay here ""def run(selfcmdline)assert sys platform[: ='winos system('start cmdlinemay create pop-up window class spawn(launchmode)""run python in new process independent of caller portable program-launch framework