#include //<-Put this FIRST! #include static PyObject* qd(PyObject *self, PyObject *args) { PyObject *obj; char *msg; if (!PyArg_ParseTuple(args,"O",&obj)) return NULL; //<-Something didn't work! //I really should check PyCObject_Check here! if (!PyCObject_Check(obj)) printf("Ah, frig.\n"); msg=(char*)PyCObject_AsVoidPtr(obj); printf("%s\n",msg); //return Py_BuildValue("i",_fact(value)); return Py_None; } //If it ain't here, it ain't in the module //Always terminate with {NULL,NULL,0,NULL} static PyMethodDef babyMethods[]={ {"qd",qd,METH_VARARGS,"Sigh."}, {NULL,NULL,0,NULL} }; PyMODINIT_FUNC initbaby(void) { (void) Py_InitModule("baby",babyMethods); }