I\'ve got a C python extension, and I would like to print out some diagnostics.
I\'m receiving a string as a PyObject*.
What\'s the canonical way to obtain a
If you need just print the object in Python 3 you can use one of these functions:
static void print_str(PyObject *o) { PyObject_Print(o, stdout, Py_PRINT_RAW); } static void print_repr(PyObject *o) { PyObject_Print(o, stdout, 0); }