PyErr_Occurred() and debugging

Max lu_gio at hotmail.com
Mon Oct 7 18:00:21 EDT 2002


Hi!
I try to debug a python script embedded in a vc++ win32 app.
I need to catch exceptions and print the error message with the traceback.

 if(PyErr_Occurred()){
  PyErr_Print();
  return;
 }

Now, I have two questions...
How can I redirect the error to the vc debug panel?

Is it possible to debug the python script in plain text, like in PythonWin?
I mean... I have the Update method called by c++ code:

t=0
def Update():
    global t
    t=t+1
    if t>=1000:
        t=0
    return t

Can I debug it with the vc++ debugger, row by row, without inspecting the
PyObject (it's not so easy)?

Thanks.





More information about the Python-list mailing list