1234567891011121314151617181920212223242526 |
- #ifndef __CALL_PYTHON__
- #define __CALL_PYTHON__
- #include "Python.h"
- #include <comdef.h>
- // 使用垫片类处理;
- class CCallPython {
- PyGILState_STATE _state;
- public:
- CCallPython();
- ~CCallPython();
- static void Init();
- static void Free();
-
- // 调用Python脚本指定函数;
- PyObject* CallPython(std::string strPyPath, std::string strPyFuncName, int argc, ...);
- int GetIntegerValue(PyObject *pValue);
- std::string GetUnicodeString(PyObject* pValue);
- std::string GetUTF8String(PyObject* pValue);
- };
- #endif
|