python Programming Glossary: pyerr_setstring
Writing Python bindings for C++ code that use OpenCV http://stackoverflow.com/questions/12957492/writing-python-bindings-for-c-code-that-use-opencv va_start ap fmt vsnprintf str sizeof str fmt ap va_end ap PyErr_SetString PyExc_TypeError str return 0 class PyAllowThreads public PyAllowThreads.. allowThreads expr catch const cv Exception e PyErr_SetString opencv_error e.what return 0 using namespace cv static PyObject.. va_start ap fmt vsnprintf str sizeof str fmt ap va_end ap PyErr_SetString PyExc_TypeError str return 0 static size_t REFCOUNT_OFFSET size_t..
How do I propagate C++ exceptions to Python in a SWIG wrapper library? http://stackoverflow.com/questions/1394484/how-do-i-propagate-c-exceptions-to-python-in-a-swig-wrapper-library exception do_something try action catch MyException e PyErr_SetString pMyException const_cast char e.what return NULL The usual functions..
Stopping embedded Python http://stackoverflow.com/questions/1420957/stopping-embedded-python is running. To stop one has a few possibilities PyErr_SetString PyExc_KeyboardInterrupt ... or PyErr_SetInterrupt the first..
How do you extend python with C++? http://stackoverflow.com/questions/2847617/how-do-you-extend-python-with-c NULL int rv PyDict_DelItemString self x_attr name if rv 0 PyErr_SetString PyExc_AttributeError delete non existing Flp attribute return.. NULL int rv PyDict_DelItemString self x_attr name if rv 0 PyErr_SetString PyExc_AttributeError delete non existing Flp attribute return..
Python file modes detail http://stackoverflow.com/questions/654499/python-file-modes-detail s mode while s switch s case 'r' if rwa bad_mode PyErr_SetString PyExc_ValueError Must have exactly one of read write append..
wrapping a list of structs with boost.python http://stackoverflow.com/questions/6776888/wrapping-a-list-of-structs-with-boost-python T const_iterator it x.begin it x.end it i if it v return i PyErr_SetString PyExc_ValueError Value not in the list throw boost python error_already_set.. pos 0 pos i pos it if i 0 i int x.size x.erase it else PyErr_SetString PyExc_IndexError Index out of range boost python throw_error_already_set.. it x.begin for int pos 0 pos i pos it return it else PyErr_SetString PyExc_IndexError Index out of range throw boost python error_already_set..
Boost.Python custom exception class http://stackoverflow.com/questions/9620268/boost-python-custom-exception-class
|