#include <boost/python.hpp>
using namespace boost::python;
int mul(int a, int b){
return a * b;
}
BOOST_PYTHON_MODULE(NPC){
def("mul", mul);
}
int main(int argc, char **argv) {
Py_Initialize();
initNPC();
object result = exec("import NPC\n"
"print NPC.mul(2, 3)");
}
И посоветуйте что-нибудь почитать на подобие раздела “Extending Embedded Python” в доках питона, тока применительно к Boost.