Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 9b24649118b99987a42fcab0a9793bd5d2b0d762 authored by cvs2svn on 15 August 1997, 20:18:44 UTC
This commit was manufactured by cvs2svn to create tag 'r15a3'.
Tip revision: 9b24649
example.c
#include "Python.h"

static PyObject *
ex_foo(self, args)
	PyObject *self, *args;
{
	printf("Hello, world\n");
	Py_INCREF(Py_None);
	return Py_None;
}

static PyMethodDef example_methods[] = {
	{"foo", ex_foo, 1, "foo() doc string"},
	{NULL, NULL}
};

void
initexample()
{
	Py_InitModule("example", example_methods);
}
back to top