popen and error handling

Gerry Stringer (gerry@camscan.co.uk)
Tue, 9 Nov 93 17:09:28 GMT

Another simple question, I want to capture the output from a shell
command but I also want to know whether it was successfully executed
or not.

eg. fh = popen('rubbish','r') doesn't raise an exception so how can I
tell the difference between failed execution and no output ?

What's the standard Unix trick for doing this, I can think of a couple
of ways but they don't inspire me at the moment.

Thanks again,

gerry (gerry@camscan.co.uk)

Python 0.9.8 , SUNOS4.1.1