No matter what I do I cant get the following code to do what I expect.
I hadn't used subprocess t o read and write to pipes of a
still-running app, and I just can't seem to get it right. What gives?
import subprocess
p = subprocess.Pope n("python", stdout=subproce ss.PIPE, stdin=subproces s.PIPE)
p.stdin.write(' print 10\n')
assert p.stdout.readli ne() == '10\n'
--
Read my blog! I depend on your acceptance of my opinion! I am interesting!
I hadn't used subprocess t o read and write to pipes of a
still-running app, and I just can't seem to get it right. What gives?
import subprocess
p = subprocess.Pope n("python", stdout=subproce ss.PIPE, stdin=subproces s.PIPE)
p.stdin.write(' print 10\n')
assert p.stdout.readli ne() == '10\n'
--
Read my blog! I depend on your acceptance of my opinion! I am interesting!
Comment