C调用python

 

#include <python2.6/Python.h>

 

int main()

{

    Py_Initialize();

    PyRun_SimpleString("print /"hello, python c api/"");

    Py_Finalize();

 

    return 0;

}

gcc -o test test.c -lpython2.6
./test
ref:  http://docs.python.org/c-api/

 

你可能感兴趣的:(c,python,gcc,include)