view PC/example_nt/example.c @ 53635:abc80f8b0dfd legacy-trunk

Make the turtle.rst doctests pass. I have a feeling there should be more cleanup, but I don't know now to kill turtles. Especially unexpected ones... ;)
author R. David Murray <rdmurray@bitdance.com>
date Thu, 30 Apr 2009 12:42:32 +0000
parents a5298f371be7
children bd0e361bd642
line wrap: on
line source

#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);
}