source: trunk/essentials/dev-lang/python/PC/example_nt/example.c@ 3408

Last change on this file since 3408 was 3225, checked in by bird, 19 years ago

Python 2.5

File size: 340 bytes
Line 
1#include "Python.h"
2
3static PyObject *
4ex_foo(PyObject *self, PyObject *args)
5{
6 printf("Hello, world\n");
7 Py_INCREF(Py_None);
8 return Py_None;
9}
10
11static PyMethodDef example_methods[] = {
12 {"foo", ex_foo, METH_VARARGS, "foo() doc string"},
13 {NULL, NULL}
14};
15
16PyMODINIT_FUNC
17initexample(void)
18{
19 Py_InitModule("example", example_methods);
20}
Note: See TracBrowser for help on using the repository browser.