import internalProcess import subprocess import json #Стартуем процесс winGUI 32bit lWinGUIx32 = subprocess.Popen(['WPy32-3720\\python-3.7.2\\python.exe','winGUI.py'],stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE) lScriptJSON='[{"functionName":"ElementRunAction","argsArray":[[{"title":"Taskbar","class_name":"Shell_TrayWnd","ctrl_index":null},{"title":"SSH, Telnet and Rlogin client","depth_end":2}],"click",[]]},{"functionName":"PywinautoExtElementWaitAppear","argsArray":[[{"title":"PuTTY Configuration","class_name":"PuTTYConfigBox"}]]},{"functionName":"ElementRunAction","argsArray":[[{"title":"PuTTY Configuration","class_name":"PuTTYConfigBox"},{"title":"Host Name (or IP address)","class_name":"Edit"}],"set_text",["HostNameTest"]]},{"functionName":"ElementRunAction","argsArray":[[{"title":"PuTTY Configuration","class_name":"PuTTYConfigBox"},{"title":"Raw"}],"click_input",["HostNameTest"]]},{"functionName":"ElementRunAction","argsArray":[[{"title":"PuTTY Configuration","class_name":"PuTTYConfigBox"},{"title":"Saved Sessions","class_name":"Edit"}],"set_text",["SavedSessionTest"]]},{"functionName":"ElementRunAction","argsArray":[[{"title":"PuTTY Configuration","class_name":"PuTTYConfigBox","ctrl_index":null},{"title":"Connection","depth_end":2}],"set_focus",[]]},{"functionName":"PywinautoExtElementWaitAppear","argsArray":[[{"title":"PuTTY Configuration","class_name":"PuTTYConfigBox"},{"title":"Logical name of remote host"}]]},{"functionName":"ElementRunAction","argsArray":[[{"title":"PuTTY Configuration","class_name":"PuTTYConfigBox"},{"title":"Logical name of remote host (e.g. for SSH key lookup):","class_name":"Edit"}],"set_text",["It works!"]]}]' #Превращение массива байт в объект lInputObject=json.loads(lScriptJSON) #Отправить на исполнение internalProcess.ProcessChildSendReadWaitQueueObject(lWinGUIx32,lInputObject) #Тест одной операции lInputObject=( {"functionName":"ElementRunAction", "argsArray": [ [ {"title":"Taskbar", "class_name":"Shell_TrayWnd", "ctrl_index":None}, {"title":"SSH, Telnet and Rlogin client", "depth_end":2} ], "click", [] ] }) lResponseObject=internalProcess.ProcessChildSendReadWaitObject(lWinGUIx32,lInputObject)