为什么通信会杀死我的进程?我想要一个交互式过程,但通信会做一些事情,这样我就不能再在我的过程中使用 raw_input 了。
from sys import stdin
from threading import Thread
from time import sleep
if __name__ == '__main__':
print("Still Running\n")
x = raw_input()
i = 0
while ('n' not in x ) :
print("Still Running " + str(i) + " \r\n")
x = raw_input()
i += 1
print("quit")
print(aSubProc.theProcess.communicate('y'))
print(aSubProc.theProcess.communicate('y'))
例外!
self.stdin.write(input)
ValueError: I/O operation on closed file