python 3.x C extension module and submodule
问题 How do I make a C extension for python 3.x when a module has sub-modules? For example, I have a file called pet.c: #include <Python.h> PyObject* CatMeow(PyObject* self) { return PyUnicode_FromString( ">*<" ); } static PyMethodDef CatFunctions[] = { {(char*) "meow", (PyCFunction) CatMeow, METH_NOARGS, NULL}, {NULL, NULL, 0, NULL} }; static PyModuleDef CatDef = { PyModuleDef_HEAD_INIT, "cat", "cat ext", -1, CatFunctions, NULL, NULL, NULL, NULL }; PyMODINIT_FUNC PyInit_cat(void) { return