import subprocess

childStdOut = open("foo-test-output-out", 'w')
childStdErr = open("foo-test-output-err", 'w')

try:
    child = subprocess.Popen(
        ["echo", "foo"],
        stderr = childStdErr,
        stdout = childStdOut
    )
except OSError, e:
    print "Tried to run: %s but got this error: %s" + (repr(commandWithArgs), str(e))
