I need to open the external program (Blue Prism) and trigger the workflow. Once the work flow completed the process, I need to terminate the program. So I open the program using A=Subprocess.Popen("program to open") And I close the program using A.terminate() So how do I monitor the in-between process? How to read the process status whether it's completed or failed etc., Thanks
Asked
Active
Viewed 111 times
0
-
check `A.poll()`. If `None`, running, else it's return code – Jean-François Fabre Jan 14 '19 at 15:19
-
Jean-François Fabre -Thanks for sharing the link. Additional to the above code, I have A.communicate and A.returncode between open and terminate...now its showing me process started and immediately returning the return code as 0. However I need to see the process status.. what it returns completed or failed etc., – DKS Jan 14 '19 at 17:59
-
problem if is process "detaches" you need to attach it again, on windows I prefix it with `cmd /c` – Jean-François Fabre Jan 14 '19 at 18:52