ここのソースをちょこっと改造しただけ。 ---- コード(Python側) testmodule.py ---- # -*- coding: utf-8 -*- def testplus(i, j): return i + j + 3 ---- コード(C++側) ---- #include <Python.h> #include <iostream> #include <string> #include <sstream> #define VARNAME(var) #var // ---- exception ---- class PythonException { protected: const char* message_; const char* varName_; public: static const char* errorMessge_ImportModule; stat