pass bool values to the Python function in embedded python 3.0

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sat Mar 7 15:38:18 CET 2009


En Sat, 07 Mar 2009 07:38:29 -0200, BigHand <heweiwei at gmail.com> escribió:

> how do I pass True to the Python function in the C++ code?

(I've already suggested using PyErr_Print/PyTraceback_Print instead)

See the section "Boolean Objects" in the C API Reference:

"PyObject* Py_True
The Python True object. This object has no methods. It needs to be treated  
just like any other object with respect to reference counts."

-- 
Gabriel Genellina




More information about the Python-list mailing list