Question - Returning exit codes

Gerrit Holl gerrit.holl at pobox.com
Thu Jun 24 16:40:30 CEST 1999


On Thu, Jun 24, 1999 at 01:27:07PM +0000, 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.
> 

#!/usr/bin/python
"""example on using exit codes"""

import sys

def exit_with_code():
    number = input("What exit code do you want? ")
    sys.exit(number)

if __name__ == '__main__':
    exit_with_code()



or easier:

sys.exit(1)

groeten,
Gerrit.

-- 
The Dutch Linuxgames homepage:	http://linuxgames.nl.linux.org
Personal homepage:		http://www.nl.linux.org/~gerrit/

Discoverb is a python program in Dutch and English which tests the words you
learned by asking it. Homepage: http://www.nl.linux.org/~gerrit/discoverb/




More information about the Python-list mailing list