to use the techniques shown in this file to reuse any python class of coursethis example could be more complex in practice as mentioned earlieryou generally need to check the return value of every python api call to make sure it didn' fail the module import call in this codefor instancecan fail easily if the module isn' on the search pathif you don' trap the null pointer resultyour program will almost certainly crash when it tries to use the pointer (at least eventuallyexample - is recoding of example - with full error-checkingit' bigbut it' robust example - pp \integrate\embed\pyclasss\objects-err #include #include #define error(msgdo printf("% \ "msg)exit( )while ( main(/run objects with low-level calls and full error checking *char *arg ="sir"*arg ="robin"*cstrpyobject *pmod*pclass*pargs*pinst*pmeth*pres/instance module klass(*py_initialize()pmod pyimport_importmodule("module")if (pmod =nullerror("can' load module")pclass pyobject_getattrstring(pmod"klass")py_decref(pmod)if (pclass =nullerror("can' get module klass")pargs py_buildvalue("()")if (pargs =nullpy_decref(pclass)error("can' build arguments list")pinst pyeval_callobject(pclasspargs)py_decref(pclass)py_decref(pargs)if (pinst =nullerror("error calling module klass()")/fetch module */fetch module class */call class(*/result instance method( , *pmeth pyobject_getattrstring(pinst"method")/fetch bound method *py_decref(pinst)if (pmeth =nullerror("can' fetch klass method")pargs py_buildvalue("(ss)"arg arg )if (pargs =nullpy_decref(pmeth)error("can' build arguments list")/convert to python *using python classes in