python, subprocess: reading output from subprocess

前端 未结 6 1420
暗喜
暗喜 2020-12-09 18:57

I have following script:

#!/usr/bin/python

while True:
    x = raw_input()
    print x[::-1]

I am calling it from ipython:

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-09 19:06

    When you are through writing to p.stdin, close it: p.stdin.close()

提交回复
热议问题