source:
vendor/python/2.5/PC/example_nt/example.c
| Last change on this file was 3225, checked in by , 19 years ago | |
|---|---|
| File size: 340 bytes | |
| Line | |
|---|---|
| 1 | #include "Python.h" |
| 2 | |
| 3 | static PyObject * |
| 4 | ex_foo(PyObject *self, PyObject *args) |
| 5 | { |
| 6 | printf("Hello, world\n"); |
| 7 | Py_INCREF(Py_None); |
| 8 | return Py_None; |
| 9 | } |
| 10 | |
| 11 | static PyMethodDef example_methods[] = { |
| 12 | {"foo", ex_foo, METH_VARARGS, "foo() doc string"}, |
| 13 | {NULL, NULL} |
| 14 | }; |
| 15 | |
| 16 | PyMODINIT_FUNC |
| 17 | initexample(void) |
| 18 | { |
| 19 | Py_InitModule("example", example_methods); |
| 20 | } |
Note:
See TracBrowser
for help on using the repository browser.
