RunPython.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // RunPython.cpp : 定义 DLL 应用程序的导出函数。
  2. //
  3. #include "stdafx.h"
  4. #include "RunPython.h"
  5. #include "ScriptExecutor.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #endif
  9. // 唯一的应用程序对象
  10. CWinApp theApp;
  11. using namespace std;
  12. BOOL Python27Dir(LPTSTR lpPython27Dir, int nBufferLen);
  13. int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
  14. {
  15. int nRetCode = 0;
  16. // 初始化 MFC 并在失败时显示错误
  17. if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
  18. {
  19. // TODO: 更改错误代码以符合您的需要
  20. _tprintf(_T("错误: MFC 初始化失败\n"));
  21. nRetCode = 1;
  22. }
  23. else
  24. {
  25. while(true)
  26. {
  27. // TODO: 在此处为应用程序的行为编写代码。
  28. CScriptExecutor excutor;
  29. excutor.InitScript(
  30. //"E:\\bin\\ScbcCopyKey\\ScbcTest.py",
  31. "D:\\SAT\\runner\\btc_runner_se\\runner\\output\\ODF_NPI_RT2841\\20191119172310094\\192.168.1.119_5555\\cases\\RT_2841\\ODF_NPI_RT2841\\picture\\22.py",
  32. "D:\\SAT\\log.txt",
  33. "",
  34. SUBPROCESS);
  35. excutor.StartScript();
  36. Sleep(500);
  37. while( !excutor.IsScriptOver() )
  38. Sleep(100);
  39. Sleep(2000);
  40. OutputDebugString("--------------------------------------\n");
  41. }
  42. }
  43. system("pause");
  44. return nRetCode;
  45. }