process = subprocess.Popen([PathToProcess], stdin=subprocess.PIPE, stdout=
    subprocess.PIPE)
for i in range(StepsToComplete):
    pass
Starting and Controlling an External Process via STDIN/STDOUT with Python