How do I run an external system command on Windows?

noahspurrier at noahspurrier at
Tue Sep 19 00:05:45 CEST 2000

Wait! I take it back, because os.system() does not return you the
as a string. You get the exit code, but all output is lost. I suppose I
could redirect it to a file and then read it in, but that would not be
much fun.

I want the functionality of the commands module on UNIX <b>and</b>
Windows NT -- Or even just WinNT! Now I can't figure out how
to do it under Windows...

But thanks anyway.


In article <8q5efg$b1e$1 at>,
  aahz at (Aahz Maruch) wrote:
> In article <8q5d2b$la8$1 at>,  <noahspurrier at>
> >
> >Does Python have something similar to Perl's "system" command or the
> >(backtick operator)? This would preferably be something cross-
> >I need this to work on Windows NT Win2K) and UNIX (OpenBSD).
> os.system()
> --
>                       --- Aahz (Copyright 2000 by aahz at
> Androgynous poly kinky vanilla queer het    <*>
> Hugs and backrubs -- I break Rule 6
> The best way to get information on Usenet is not to ask a question,
> to post the wrong information.  --Aahz

Sent via
Before you buy.

More information about the Python-list mailing list