grabbing return codes from os.system() call

Gregory Jorgensen gregj at pobox.com
Sun Mar 11 00:47:01 EST 2001


In article <x8Gp6.899$54.943 at www.newsranger.com>, Gregory Jorgensen says...
>
>os.system returns the exit status. The low-order byte of the exit status is the
>signal number that killed the process, and the high-order byte is the exit
>status (if the signal number is 0). This only works under Unix; on Windows the
>exit status is always 0.

Actually the current docs at python.org say that Windows 95 and 98 always return
0. Apparently Windows NT and 2000 do return something. I don't know about Win
ME. The Beazley book "Python Essential Reference" (which I used) says "On
Windows, the exit code is always 0" in the description of os.system.

Greg Jorgensen
Deschooling Society
Portland, Oregon, USA
gregj at pobox.com



More information about the Python-list mailing list