我有两台机器,通过远程登录、PC1和PC2连接。
我在PC1上运行,这是一个通过来自PC2的GSclient存储在PC1上的progress-4gl脚本。
该脚本运行一个批处理脚本,该脚本启动在PC2上运行的python脚本。
该python脚本按预期运行,然后返回PC1上进度脚本中其余代码所需的输出,我猜这就是所谓的“父脚本”。
如何将输出从PC2上python脚本返回到PC1上的批处理脚本,再返回到PC1上的“父脚本”?
目前,我在"parent“上使用OUTPUT THROUGH来运行批处理。在批处理中,我使用GS_exec.exe在PC2上运行python脚本。
进度。p:
def var script_to_run as c.
script_to_run = "path/to/script/to/run/on/PC2/script.py".
output through value("path/to/exe_python.bat " + script_to_run ).exe_python.bat:
@echo off
set INFILE=%~f1
C:\GS_UTS\GS_Exec.exe "python %INFILE%"script.py:
codecodecode...
return output预期的结果是:进度代码在PC1>上运行,批处理在PC1>上运行,python代码在PC2>上运行,python代码返回到PC1>上的批处理,返回到原始的进度代码。
实际结果是:进度代码在PC1>上运行,批处理在PC1>上运行,python代码在PC2>上运行,输出不会在任何地方返回,并且在完成python代码后,原始代码只是在没有期望的输出的情况下运行。
发布于 2019-08-05 22:59:14
要将Python的输出返回给Progress,您可以在Progress代码中使用INPUT THROUGH。(Progress的输入是Python代码的输出。)
define variable script_to_run as character no-undo.
define variable result as character no-undo.
script_to_run = "path/to/script/to/run/on/PC2/script.py".
INPUT THROUGH value( "path/to/exe_python.bat " + script_to_run ).
import unformatted result.
display result.https://stackoverflow.com/questions/57360464
复制相似问题