Kann man das für Pyhon benutzen?
http://www.cl.uni-heidelberg.de/kurs/sk ... ge058.html
Hier gibt es was. Steige aber nicht durch mit welchem Compiler das Ding ablaufen kann?
Dev c++?
Wo bekomme ich die Python.h her?
Muss ich die in den Ordner von Dev c++ packen und dann mit Dev c++ compilieren?
Oder wie läuft das ab?
Danke.
Gruss
Code: Alles auswählen
#include <Python.h>
#include <stdio.h>
static PyObject *hello_printHello(PyObject *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, "")) {
return NULL;
}
printf("Hello world!\n");
Py_INCREF(Py_None);
return Py_None;
}
static PyMethodDef helloMethods[] = {
{"printHello", hello_printHello, METH_VARARGS,
"Prints ’Hello World’."},
{NULL, NULL, 0, NULL},
};
void inithello(void)
{
Py_InitModule("hello", helloMethods);
}