capturing system exit status
cam.ac.uk at mh391.invalid
Mon Apr 2 03:35:51 CEST 2007
> in a program I'm writing I have several commands I pass to the unix OS
> underneath the code.
> I want to perform error checking to make sure that the OS commands'
> exit gracefully, but I'm not seeing a simple python module to do this.
If you're using Python 2.5, you can use subprocess.check_call() which
will raise CalledProcessError for nonzero exit code. If you're using
Python 2.4, you can use retcode = subprocess.call() and check it yourself.
More information about the Python-list