我有这个子流程需要恢复。
第一个popen
是:
try:
j = subprocess.Popen(["C:\Program Files (x86)\python\python.exe",r"C:\Program Files (x86)\python\New folder\main\training\news-please-master\news-please-master\newsplease\__main__.py","-c newsplease/config"],stdout=subprocess.PIPE,shell = True)
return "0"
except:
return "1"
第二个popen
是:
try:
i = j.poll()
if (i == None):
k = subprocess.Popen(["python",r"__main__.py","-c newsplease/config","-resume"],stdin=j.stdout,stdout=subprocess.PIPE)
return "0"
else:
return "1"
except:
return "1"
这两个popen的使用方法不同。我需要从第二个popen
恢复第一个popen
,因为这是两个不同的对象,但是我只需要恢复第一个对象。该怎么做?