[Tutor] Getting exit code in Windows

Sheila King sheila@thinkspot.net
Sun, 31 Mar 2002 21:34:03 -0800


On Sun, 31 Mar 2002 21:24:31 -0800, Sheila King wrote:
> On Mon, 1 Apr 2002 00:19:24 -0600, Victor R. Cardona wrote:
> > Hi everyone,
> >
> > I am writing a simple shell in python as a small demonstration
> > project.
> > I have figured out how to get the exit code for a process on UNIX
> > using the waitpid function in the os module. Unfortunately, this
> > function does not seem to exist on Windows. Is there a portable
> > way of getting that kind of information? I know I could use the
> > win32all extensions, but I wanted to make sure there was not a
> > better way.

>
> I've written portable scripts that I run on both Unix and Windows,
> that return the exit code with the following command:
>
> sys.exit(int)
>
>
> You must import the sys module and pass an integer as the
> parameter.

After reading your post again, I must apologize. I have not addressed 
your question at all. I told how to set an exit code, which is 
apparently not what you want to do. You want to retrieve the exit 
code of a different process.

Sorry for the confusion.


-- 
Sheila King
http://www.thinkspot.net/sheila/