From: klausfpga on
On Oct 29, 11:25 am, Rüdiger Ranft <_r...(a)web.de> wrote:
> klausfpga schrieb:
>
> > Hi,
>
> > I have a Python script which wants to start a subprocess and wait for
> > it to finish.
>
> > However I would like to have NO command window popping up during
> > execution.
>
> You need to specify the hide parameter for windows.
>
> import subprocess
> kwargs = {}
> if subprocess.mswindows:
>     su = subprocess.STARTUPINFO()
>     su.dwFlags |= subprocess.STARTF_USESHOWWINDOW
>     su.wShowWindow = subprocess.SW_HIDE
>     kwargs['startupinfo'] = su
> process = subprocess.Popen( (r'c:\python25\python.exe',
>     r'd:\projekte\bar.py'), **kwargs )

Thanks Ruediger,

I'll try that immediately tomorrow, when working again on a windows
host.

Good to know, that the Python API supports this.
though this feature was not that easy to be found in the doc.

This will make my application much nicer.
From: Rüdiger Ranft on
klausfpga schrieb:
> On Oct 29, 11:25 am, R�diger Ranft <_r...(a)web.de> wrote:

> Thanks Ruediger,
>
> I'll try that immediately tomorrow, when working again on a windows
> host.
>
> Good to know, that the Python API supports this.
> though this feature was not that easy to be found in the doc.

Well, getting the point from subproces.py was easy. Finding the
documentation about STARTUPINFO in the MSDN was not. I better stop here
before this post turns into a rant about Mircosofts use of javascript.

bye
Rudi