如何通过 gsclient 在远程计算机上获取脚本 运行 的输出?

How to get the output of a script running on remote machine via gsclient?

我有两台机器,通过 telnet 连接,PC1 和 PC2。

我正在 运行在 PC1 上使用来自 PC2 的 GSclient 存储在 PC1 上的 progress-4gl 脚本。

该脚本 运行 是一个批处理脚本,它向 PC2 上的 运行 启动 python 脚本。

那个 python 脚本 运行 是预期的,然后 return 是 PC1 上进度脚本中其余代码所需的输出,所以-我猜叫 "parent script"。

如何 return 从 PC2 上的 python 脚本输出到 PC1 上的批处理脚本,然后返回到 PC1 上的 "parent script"?

目前,我在 "parent" 上使用 OUTPUT THROUGH 到 运行 批次。 在批处理中,我使用 GS_exec.exe 到 运行 PC2 上的 python 脚本。

progress.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 上的进度代码 运行s> PC1 上的批处理 运行s> PC2 上的 python 代码 运行s> 来自 python 代码 returned 的输出在 PC1 上进行批处理> return编辑为原始进度代码。

实际结果是: 进度代码 运行s on PC1> batch 运行s on PC1> python code 运行s on PC2> output isn't returned anywhere, and the完成 python 代码后,原始代码只有 运行s 没有想要的输出。

要从 Python 返回到 Progress 的输出,您可以在 Progress 代码中使用 INPUT THROUGH。 (进度的输入是您的 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.