Prev Next error_message_xam.py Headings

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} }@)@
Python: Cppad Swig Exception Handling: Example and Test
def error_message_xam() :
     #
     # load the Cppad Swig library
     import py_cppad
     #
     # initialize return variable
     ok = True
     # ---------------------------------------------------------------------
     ok = False
     try :
          py_cppad.error_message("test message")
     except : # catch
          stored_message = py_cppad.error_message("")
          ok = (stored_message == "test message")
     #
     return( ok  )
#

Input File: build/lib/example/python/error_message_xam.py