まずはC言語のプログラムを書く /home/yoshi/python/cfunc.c #include <Python.h> static PyObject *cprint(PyObject *self, PyObject *args) { char *s; if(!PyArg_ParseTuple(args, "s", &s)) { return NULL; } printf(s, ""); return Py_None; } static PyObject *add(PyObject *self, PyObject *args) { int i1, i2; if(!PyArg_ParseTuple(args, "ii", &i1, &i2)) { return NULL; } return Py_BuildValue("i", i1 + i2); } static PyObject *