I'm looking for a Python function which behaves just like the Windows command interpreter cmd.exe
when it comes to waiting for newly launched processes to finish. Right now I'm using os.system()
but this function always blocks, even when launching GUI applications (which, in case they were written in C/C++, have a WinMain
function and were linked with /SUBSYSTEM:WINDOWS
).
What code should I be using for launching external processes in case I do want the function to block when launching console applications, but I do not want it to block when launching GUI applications?