0
0
mirror of https://github.com/python/cpython.git synced 2024-11-25 01:20:47 +01:00
cpython/PC/example_nt/example.c

21 lines
319 B
C
Raw Normal View History

#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, 1, "foo() doc string"},
{NULL, NULL}
};
void
initexample(void)
{
Py_InitModule("example", example_methods);
}