FINANCIAL MODELLING PACKAGE IN PYTHON?

Randall Hopper aa8vb at yahoo.com
Wed Jan 5 08:27:04 EST 2000


Robin Becker:
 |Is there an obvious way to allow an extension module to write messages to
 |various fd type objects?

Do you mean, change a module that's written to dump to stdout or stderr so
that it writes to objects?  You can always replace sys.stdout/stderr
before/after calling the extension module.  Not pretty, but it works.

 |Also under certain extreme circumstances my code would like to report a
 |total failure eg attempt to divide by error. I would like to ask more
 |experienced pythoneers how arithmetic errors are handled using built in
 |IEEE exceptions and how does one gracefully crash a python script? (eg
 |an abend/abort).

raise ArithmeticError, "Oops"
raise ZeroDivisionError, "Ouch"

?

-- 
Randall Hopper
aa8vb at yahoo.com




More information about the Python-list mailing list