I have a program that wants to know the exit code of some process that was separately spawned. The spawned process is not a child process of the original program, but I can get its PID. Is there a way in Python to track the exit code of a process by PID? I know about os.wait() but that only works for child processes.
I am working on Ubuntu 18.04