1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- // RunPython.cpp : 定义 DLL 应用程序的导出函数。
- //
- #include "stdafx.h"
- #include "RunPython.h"
- #include "ScriptExecutor.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- // 唯一的应用程序对象
- CWinApp theApp;
- using namespace std;
- BOOL Python27Dir(LPTSTR lpPython27Dir, int nBufferLen);
- int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
- {
- int nRetCode = 0;
- // 初始化 MFC 并在失败时显示错误
- if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
- {
- // TODO: 更改错误代码以符合您的需要
- _tprintf(_T("错误: MFC 初始化失败\n"));
- nRetCode = 1;
- }
- else
- {
- while(true)
- {
- // TODO: 在此处为应用程序的行为编写代码。
- CScriptExecutor excutor;
- excutor.InitScript(
- //"E:\\bin\\ScbcCopyKey\\ScbcTest.py",
- "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",
- "D:\\SAT\\log.txt",
- "",
- SUBPROCESS);
- excutor.StartScript();
- Sleep(500);
- while( !excutor.IsScriptOver() )
- Sleep(100);
- Sleep(2000);
- OutputDebugString("--------------------------------------\n");
- }
- }
- system("pause");
- return nRetCode;
- }
|