This should work:
si = subprocess.STARTUPINFO()
si.dwFlags=subprocess.STARTF_USESHOWWINDOW
subprocess.Popen(["application.exe"], env=os.environ.copy(), close_fds=True, startupinfo=si)
What it does is tells Popen
to use specific parameters (defined by the STARTUPINFO
object, si
) when starting the process. In this case, it tells it to use si.wShowWindow
when creating a new window, and the default value of this is SW_HIDE
, so it hides it.