1.

How Do I Run A Subprocess With Pipes Connected To Both Input And Output?

Answer»

USE the popen2 MODULE. For EXAMPLE:
import popen2
fromchild, tochild = popen2.popen2("COMMAND")
tochild.write("input\n")
tochild.flush()
output = fromchild.readline()

Use the popen2 module. For example:
import popen2
fromchild, tochild = popen2.popen2("command")
tochild.write("input\n")
tochild.flush()
output = fromchild.readline()



Discussion

No Comment Found