Skip to content

Instantly share code, notes, and snippets.

View qianlifeng's full-sized avatar
🎯
Focusing

qianlifeng qianlifeng

🎯
Focusing
View GitHub Profile
@qianlifeng
qianlifeng / gist:8123612
Created December 25, 2013 14:23
Embedding python in C
extern "C" __declspec(dllexport) char* ExecPython(char* directory, char* file, char* query)
{
try{
PyObject *pName, *pModule, *pDict, *pFunc, *pValue, *pClass, *pInstance;
// Initialise the Python interpreter
Py_Initialize();
//// Create GIL/enable threads