mirror of
https://github.com/aphrody-labs/msys2-tests.git
synced 2026-10-14 20:29:16 +00:00
29 lines
479 B
C
29 lines
479 B
C
#include <Python.h>
|
|
|
|
static PyObject *
|
|
helloworld(PyObject *self, PyObject *args)
|
|
{
|
|
printf("Hello World\n");
|
|
Py_RETURN_NONE;
|
|
}
|
|
|
|
static PyMethodDef
|
|
myMethods[] = {
|
|
{ "helloworld", helloworld, METH_NOARGS, "Prints Hello World" },
|
|
{ NULL, NULL, 0, NULL }
|
|
};
|
|
|
|
static struct PyModuleDef cwrapper = {
|
|
PyModuleDef_HEAD_INIT,
|
|
"cwrapper",
|
|
"Test Module",
|
|
-1,
|
|
myMethods
|
|
};
|
|
|
|
PyMODINIT_FUNC
|
|
PyInit_cwrapper(void)
|
|
{
|
|
return PyModule_Create(&cwrapper);
|
|
}
|