os.spawn* on Windows

Antoine mail at guildgame.com
Wed Jun 14 06:44:07 CEST 2006

Hello list

I am using Python 2.4 to invoke other programs on Windows XP, using
syntax like this:

os.spawnv(P_WAIT, "C:\\my.exe", ("C:\\my.exe",))

where my.exe is a console-mode program.

When the above statement is executed, the my.exe program creates a
window, what used to be called a Dos prompt but is no doubt called
something else now, and steals the keyboard input focus. This proves to
be highly annoying (because the window pops up unexpectedly in front of
my other windows and often steals several characters of what I am

I would rather the 'Dos prompt' was created minimised and did not steal
the input focus. Is there any way to achieve this end by using a
different Python command to invoke my.exe? Or would I have to change
my.exe itself?


More information about the Python-list mailing list