blob: 63682f11f07b84550147017caefc6cdeb116d328 [file] [log] [blame]
Guido van Rossum026f01a1996-09-06 21:16:21 +00001#include "Python.h"
2
3static PyObject *
Thomas Wouters78890102000-07-22 19:25:51 +00004ex_foo(PyObject *self, PyObject *args)
Guido van Rossum026f01a1996-09-06 21:16:21 +00005{
6 printf("Hello, world\n");
7 Py_INCREF(Py_None);
8 return Py_None;
9}
10
11static PyMethodDef example_methods[] = {
12 {"foo", ex_foo, 1, "foo() doc string"},
13 {NULL, NULL}
14};
15
16void
Thomas Wouters78890102000-07-22 19:25:51 +000017initexample(void)
Guido van Rossum026f01a1996-09-06 21:16:21 +000018{
19 Py_InitModule("example", example_methods);
20}