Next / Previous / Contents / Shipman's homepage

10. fatal(): Write a message and stop

Writes a message to sys.stderr and stops. The arguments are one or more strings comprising the message.

kkck
# - - -   f a t a l

def fatal ( *L ):
    '''Write an error message and stop.

      [ L is a list of strings ->
          sys.stderr  +:=  concatenated elements of L
          stop execution ]
    '''
    print >>sys.stderr, "*** Error: %s" % (''.join(L))
    sys.exit(1)