grabbing return codes from os.system() call

Mark Hadfield m.hadfield at niwa.cri.nz
Thu Mar 8 15:29:45 EST 2001


"Gregory Jorgensen" <gregj at pobox.com> wrote in message
news:x8Gp6.899$54.943 at www.newsranger.com...
> os.system returns the exit status. ... on Windows the
> exit status is always 0.

Not so.

On my Win 2000 box with Python 2.0, successful commands return 0 and
unsuccessful commands (where the command is not found) return 1.

Of course there may be more to it, but that's what I found in 20 s of
experimentation...

---
Mark Hadfield
m.hadfield at niwa.cri.nz  http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research





More information about the Python-list mailing list