How do I call an object's method from C?

The PyObject_CallMethod function can be used to call an arbitrary method of an object. The parameters are the object, the name of the method to call, a format string like that used with Py_BuildValue, and the argument values: