os.WIFEXITED()

os.WIFEXITED(status) → bool

Return true if the process returning ‘status’ exited using the exit() system call.