Thursday 15 March 2012

python - How to check if child process is still running? -


For a security process, I must check on re-coordination if I have a child process still alive like this Created:

  NdeProc = process (target = noderan, args = (node,)) NdeProc.start ()   

and I actually only mine Want to check in the main process if "noderan" is still going on? I have not found anything in the dock yet and I thought I might need to file a timestamp in which I would like to keep the timestamp updated by the hair process and check the original process, but I was wondering if there was any better way

Thank you!

Use this:

  if ndeProc.is_alive (): ... else: ...   

From the document:

Returning The process is largely alive, a process object is alive from that moment when The start () method returns until the child process is finished.

No comments:

Post a Comment