python - Feed string to the first Popen when several Popen are chained -
there answer how feed string popen using popen.communicate(intput=''). however, have problem of chaining several popen this:
p1 = popen(['fstcompile', '--isymbols=ascii.syms', '--osymbols=ascii.syms'], stdin=pipe, stdout=pipe) p2 = popen(['fstprint', '--isymbols=ascii.syms', '--osymbols=ascii.syms'], stdin=p1.stdout, stdout=pipe) p1.stdout.close()
i feed string stdin p1 , execute whole sequence.
i tried following:
p1.stdin.write('xxxx') p1.stdin.flush() print p2.communicate()[0]
and didn't work.
putting string p2.communicate()[0]
makes no sense , didn't work anyway.
so what's right thing in such case?
thank in advance.
Comments
Post a Comment