/PC/example_nt/example.c
http://unladen-swallow.googlecode.com/ · C · 20 lines · 17 code · 3 blank · 0 comment · 0 complexity · 6fb5f3baeff6680256fe7dd371264a21 MD5 · raw file
- #include "Python.h"
- static PyObject *
- ex_foo(PyObject *self, PyObject *args)
- {
- printf("Hello, world\n");
- Py_INCREF(Py_None);
- return Py_None;
- }
- static PyMethodDef example_methods[] = {
- {"foo", ex_foo, METH_VARARGS, "foo() doc string"},
- {NULL, NULL}
- };
- PyMODINIT_FUNC
- initexample(void)
- {
- Py_InitModule("example", example_methods);
- }