Launching command on windows

kyosohma at gmail.com kyosohma at gmail.com
Thu Sep 27 15:25:48 EDT 2007


On Sep 27, 10:46 am, Alexandre Badez <alexandre.ba... at gmail.com>
wrote:
> On Sep 27, 4:20 pm, kyoso... at gmail.com wrote:
>
>
>
> > I got it to work using subprocess.Popen
>
> > Not sure why it doesn't work with os.system though.
>
> > Mike
>
> Thanks Mike and Mauro,
>
> Mauro, your solution do not seems to work (or I made a mistake..)
> Mike your solution work great, thanks.
> But, I steel think it's a bug (python or window ??).
> I will try to take a look about it, when I have time.
>
> Alex

Some of those spawn methods from the os module don't work on Windows
although that one doesn't seem to be one of the excluded:
http://docs.python.org/lib/os-process.html.

You should use subprocess regardless as the os.system and os.spawn*
calls are to be deprecated.

http://docs.python.org/lib/module-subprocess.html

Replacing os.Popen* and os.spawn* calls with subprocess:
http://docs.python.org/lib/node534.html
http://docs.python.org/lib/node537.html

Mike




More information about the Python-list mailing list