Question - Returning exit codes

Michael P. Reilly arcege at shore.net
Thu Jun 24 10:55:22 EDT 1999


sjoshi at ingr.com wrote:
: Hello All
:    I'm calling my python program from a perl script using the system
: command. I was wondering what would be the best way to return exit
: codes from my python script so that they can be intercepted in the perl
: program.

: thanks
: Sunit

Either call sys.exit(rc) or raise the SystemExit exception with the
numeric return code.

If the exception data is not an integer, the string representation is
printed to stderr and the return code is 1.  Otherwise, nothing is
printed (no traceback) and integer is the return code.

Note: the sys.exit() function raises the SystemExit exception.

  -Arcege





More information about the Python-list mailing list