简体   繁体   English

使用processBuilder的Java / python

[英]Java/python using processBuilder

Good evening all, am running a python script inside java using processBuilder. 晚上好,我正在使用processBuilder在Java中运行python脚本。 the python script returns a list and i dont know how to get it java and use it since all i can do for the moment with process builder is print errors or outputs. python脚本返回一个列表,我不知道如何获取它并使用它,因为我现在可以使用进程生成器完成的所有操作都是打印错误或输出。 is it possible to get the list in java as well. 是否有可能在Java中获得列表。 Many thanks 非常感谢

From your scenario, you are looking for inter process communication. 从您的方案中,您正在寻找进程间的通信。

You can achieve this using shared file. 您可以使用共享文件来实现。 Your python script will write the output in text file, and your java program will read the same file. 您的python脚本会将输出写入文本文件,而您的java程序将读取相同的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM