首先配置vs2013,如前面的日志
#include “stdafx.h”
#include <Python.h>
int _tmain(int argc, _TCHAR* argv[])
{
Py_Initialize();
PyObject * pModule = NULL;
PyObject * pFunc = NULL;
pModule = PyImport_ImportModule(“1”);
pFunc = PyObject_GetAttrString(pModule, “hello”);
PyEval_CallObject(pFunc, NULL);
PyRun_SimpleString(“print ‘hell0’”);
Py_Finalize();
return 0;
}