FINANCIAL MODELLING PACKAGE IN PYTHON?

Robin Becker robin at jessikat.demon.co.uk
Wed Jan 5 12:12:37 EST 2000


In message <20000105091821.D9441 at vislab.epa.gov>, Randall Hopper
<aa8vb at yahoo.com> writes
>Robin Becker:
> |Randall Hopper:
> |>Robin Becker:
> |> |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"
> |>
> |>?
> |>
> |yes that's python, but what's the best way to do it in an existing C
> |library?
>
>And in the function that returns control to Python, do this:
>
>    PyErr_Format( PyExc_ArithmeticError, "Oops\n" );
>    return NULL;
>
>The first statement can be invoked elsewhere if desired.
>
OK then I have to catch my own C exceptions to pass back to python. How
about file descriptors. Must I have explicit control over these or must
I create something equivalent.
-- 
Robin Becker




More information about the Python-list mailing list