Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: fb0928d1176a1e517cc5e46aeafbf54ff5c2554c authored by Barry Warsaw on 09 March 2010, 22:31:52 UTC
Bumping to 2.6.5rc2
Tip revision: fb0928d
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