home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / Languages / Python / python-14-src / PC / example_nt / example.c next >
Encoding:
C/C++ Source or Header  |  1997-01-17  |  319 b   |  22 lines

  1. #include "Python.h"
  2.  
  3. static PyObject *
  4. ex_foo(self, args)
  5.     PyObject *self, *args;
  6. {
  7.     printf("Hello, world\n");
  8.     Py_INCREF(Py_None);
  9.     return Py_None;
  10. }
  11.  
  12. static PyMethodDef example_methods[] = {
  13.     {"foo", ex_foo, 1, "foo() doc string"},
  14.     {NULL, NULL}
  15. };
  16.  
  17. void
  18. initexample()
  19. {
  20.     Py_InitModule("example", example_methods);
  21. }
  22.