Back to index

python3.2  3.2.2
Functions | Variables
example.c File Reference
#include "Python.h"

Go to the source code of this file.

Functions

static PyObjectex_foo (PyObject *self, PyObject *args)
PyMODINIT_FUNC PyInit_example (void)

Variables

static PyMethodDef example_methods []
static struct PyModuleDef

Function Documentation

static PyObject* ex_foo ( PyObject self,
PyObject args 
) [static]

Definition at line 4 of file example.c.

{
    printf("Hello, world\n");
    Py_INCREF(Py_None);
    return Py_None;
}

Definition at line 29 of file example.c.

{
    return PyModule_Create(&examplemodule);
}

Variable Documentation

Initial value:
 {
    {"foo", ex_foo, METH_VARARGS, "foo() doc string"},
    {NULL, NULL}
}

Definition at line 11 of file example.c.

struct PyModuleDef [static]
Initial value:
 {
    PyModuleDef_HEAD_INIT,
    "example",
    "example module doc string",
    -1,
    example_methods,
    NULL,
    NULL,
    NULL,
    NULL
}

Definition at line 16 of file example.c.