File: class/Workbook/Examples/Lecture16/objects2.c
#include <stdio.h>
#include "pyembed.h"
main () {
int failflag;
PyObject *pinst;
char *arg1="sir", *arg2="robin", *cstr;
failflag =
Run_Function("module", "klass", /* module.klass() */
"O", &pinst, "()") /* result, args */
||
Run_Method(pinst, "method", /* pinst.method() */
"s", &cstr, /* result fmt/ptr */
"(ss)", arg1, arg2); /* args fmt/values*/
printf("%s\n", (!failflag) ? cstr : "Can't call objects");
Py_XDECREF(pinst);
}