3

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

2
  • 2
    You've been asking a lot of questions about the Python C API recently. Have you tried looking at the documentation? Commented Jun 2, 2012 at 5:10
  • 1
    I knew this function exists, but I couldn't find it easily in the documentation and had to resort to google, so I can see why the OP asked this question. Commented Nov 24, 2013 at 1:31

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.