Python subprocess: callback when cmd exits
You’re right – there is no nice API for this. You’re also right on your second point – it’s trivially easy to design a function that does this for you using threading. import threading import subprocess def popen_and_call(on_exit, popen_args): “”” Runs the given args in a subprocess.Popen, and then calls the function on_exit when the … Read more