get the return code when piping something to a python script?

mhenry1384 mhenry1384 at
Tue Aug 16 19:55:16 CEST 2005

On WinXP, I am doing this

nant.exe | python

This command always returns 0 (success) because always
succeeds. looks like this

while 1:
    line = sys.stdin.readline()
    if not line:

How do I set the return code from based on the return of
nant.exe?  Is this possible?  I have googled around for an hour wihtout
success.  I understand that I could have call "nant.exe",
but for various reasons, that's not idea for my situation.

More information about the Python-list mailing list