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

BranoZ zarnovican at
Tue Aug 16 20:38:31 CEST 2005

mhenry1384 wrote:
> On WinXP, I am doing this
> nant.exe | python
> How do I set the return code from based on the return of
> nant.exe?  Is this possible?

I don't know how it is on WinXP, but in UNIX you IMHO cannot easily
get the retcode of the peer _if_ the pipe was created by your common
parent, the shell. Only the parent knows retcodes of its children.

You can communicate the status over the pipe. E.g. when producer will
successufuly finish it will write (let say) last line with only one '.'

Didn't help you much..


More information about the Python-list mailing list