“subprocess.Popen” - checking for success and errors

前端 未结 5 2143
迷失自我
迷失自我 2020-11-30 07:29

I want to check if a subprocess has finished execution successfully or failed. Currently I have come up with a solution but I am not sure if it is correct and reliable. Is i

5条回答
  •  一向
    一向 (楼主)
    2020-11-30 07:45

    You can check return code of the process using check_call() method. In case if process returned non-zero value CalledProcessError will be raised.

提交回复
热议问题