Staging
v0.8.1
https://github.com/python/cpython
Revision 9f22ca285aeebb9678ecf0fe2e53546d36189b45 authored by Martin v. Löwis on 21 February 2008, 10:07:08 UTC, committed by Martin v. Löwis on 21 February 2008, 10:07:08 UTC
1 parent bcffd10
Raw File
Tip revision: 9f22ca285aeebb9678ecf0fe2e53546d36189b45 authored by Martin v. Löwis on 21 February 2008, 10:07:08 UTC
Tagging for release of Python 2.5.2
Tip revision: 9f22ca2
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