Jim_9 15 Newbie Poster

There is a high quality, open source COBOL compiler called GnuCOBOL. It translates COBOL code to C, which can then be compiled to machine language on just about any platform. GnuCOBOL can use a variety of database engines, including the C-ISAM database, which is compatible with MicroFocus. If you take a MicroFocus program and re-compile it with GnuCOBOL, it will usually run several times faster. And the resulting program will also run much faster than an equivalent Python program.

rproffitt commented: Late but good info. +15
Jim_9 15 Newbie Poster

I had a similar problem when I was trying to run Excel. If would work if Excel wasn't running, but would fail when other instances of Excel were already in memory. The code shown below worked for me. I think it might work with programs like Matlab that spawn subprocesses, because child processes inherit stdin and stdout from their parent.

from subprocess import Popen, PIPE, STDOUT
P=Popen('EXCEL.EXE',shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT)
Excel_output=P.stdout.read()
Status=P.wait()