Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 16ec24a1920dd4e94e2890032b5c4160621d526d authored by Barry Warsaw on 04 June 2011, 00:02:47 UTC
Replay svn r88850.
Tip revision: 16ec24a
example.c
#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);
}
back to top