File: example.c

package info (click to toggle)
python2.4 2.4.1-2sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 47,012 kB
  • ctags: 86,497
  • sloc: ansic: 304,593; python: 268,756; makefile: 3,843; perl: 3,736; lisp: 3,678; sh: 2,206; xml: 894; objc: 747; cpp: 7; sed: 2
file content (20 lines) | stat: -rw-r--r-- 319 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#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);
}