Python equivalent of shell's '$?'

Dave Swegen dswegen at software.plasmon.com
Fri May 31 06:07:00 EDT 2002


If I call an external program from a python script, how do I check that
programs exit status? In sh I would simply check the $? variable, but I
can't seem to find any equivalent in python. Or does python suffer from
the same unreliabilty as perl in this regard (I've learnt that catching
errors from sub shells is highly unreliable, and ended up having not
checking for errors, as I would sometimes get spurious results back).

Any info much appreciated.

Cheers
    Dave





More information about the Python-list mailing list