从Java和Python中返回参数

huangapple go评论84阅读模式
英文:

Returning arguments from Java and Python

问题

想象一下,我有一个名为real.java的脚本,它需要将参数ABC传递给一个名为code.py的Python脚本。然后,code.py执行一些操作,并且需要将参数fifoo返回给real.java。但我不知道如何在Java和Python中创建这个函数。

英文:

Imagine I have script real.java which has to pass arguments A, B and C to a python script code.py. Then, code.py does something and have to return arguments fi and foo to real.java. But I do not know how to do create that function in java neither in Python

答案1

得分: 1

你可以使用ProcessBuilder,或者你可以使用类似jython的东西。
<br>ProcessBuilder示例:https://stackoverflow.com/questions/55388121/how-to-return-value-from-python-script-to-java-using-processbuilder
Jython文档:https://www.jython.org/

英文:

You can use ProcessBuilder or you can use something like jython.
<br>ProcessBuilder example: https://stackoverflow.com/questions/55388121/how-to-return-value-from-python-script-to-java-using-processbuilder
Jython Documentation: https://www.jython.org/

huangapple
  • 本文由 发表于 2020年9月14日 03:35:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/63874816.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定