CallPython.h 504 B

1234567891011121314151617181920212223242526
  1. #ifndef __CALL_PYTHON__
  2. #define __CALL_PYTHON__
  3. #include "Python.h"
  4. #include <comdef.h>
  5. // 使用垫片类处理;
  6. class CCallPython {
  7. PyGILState_STATE _state;
  8. public:
  9. CCallPython();
  10. ~CCallPython();
  11. static void Init();
  12. static void Free();
  13. // 调用Python脚本指定函数;
  14. PyObject* CallPython(std::string strPyPath, std::string strPyFuncName, int argc, ...);
  15. int GetIntegerValue(PyObject *pValue);
  16. std::string GetUnicodeString(PyObject* pValue);
  17. std::string GetUTF8String(PyObject* pValue);
  18. };
  19. #endif