سؤال

Just can't find the right function. Thanks for advice.

هل كانت مفيدة؟

المحلول

You're looking for PyObject_Str:

PyObject* PyObject_Str(PyObject *o)

Return value: New reference.

Compute a string representation of object o. Returns the string representation on success, NULL on failure. This is the equivalent of the Python expression str(o). Called by the str() built-in function and by the print statement.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top