File: pyedit-products/unzipped/docetc/examples/Assorted-demos/trimmed-sequence-popen-code.py
# prior sequncecoding (delete me soon) """ ---------------------------------------------------------------------- # launch the proxy to launch the program # split input args per shell syntax, not on just any whitespace if RunningOnWindows: splitcmdargs = cmdargs.split() # whitespace on windows else: splitcmdargs = shlex.split(cmdargs) # this works on unix only! if (hasattr(sys, 'frozen') and # frozen exe PyEdit package sys.frozen != 'macosx_app'): # not for Mac app: Python exe os.environ['PYTHONUNBUFFERED'] = 'True' # -u equiv proxy = 'subprocproxy' cmdseq = [proxy, thefile] + splitcmdargs) else: proxy = 'subprocproxy.py' mydir = os.path.abspath(os.path.dirname(__file__)) proxy = os.path.join(mydir, proxy) python = pythonexecutable or sys.executable # user's or mine cmdseq = [python, '-u', proxy, thefile] + splitcmdargs) doshell = RunningOnWindows subproc = subprocess.Popen( cmdseq, # unix string cmds fail if !shell shell=doshell, # avoid cmd prompt for win exe universal_newlines=True, # text mode, auto decode/eoln stdout=subprocess.PIPE, # capture sub's stdout here stdin=subprocess.PIPE, # provide sub's stdin here stderr=subprocess.STDOUT) # route sub's stderr to its stdout ---------------------------------------------------------------------- """