Home
Sign Up
Sign In
V2EX
›
问与答
Java 调用 Python 可执行程序,获取打印结果
cnmllll
·
May 18, 2020
· 1850 views
This topic created in 2276 days ago, the information mentioned may be changed or developed.
我想到的方法,python 程序打印结果就是重定向到文件中,之后再读取这个文件的内容
请问还有其他方法么?
Python
打印
文件
程序
3 replies
•
2020-05-18 09:56:01 +08:00
1
12tall
May 18, 2020
好像可以将 python 进程的 stdio 重定向你的 Java 进程吧,在 nodejs 和 C# 这样弄过
2
Vegetable
May 18, 2020
直接读取 stdout 就行了,再写文件没必要了。
https://stackoverflow.com/questions/5711084/java-runtime-getruntime-getting-output-from-executing-a-command-line-program
3
cnmllll
OP
May 18, 2020
@
Vegetable
谢谢 懂了
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Solana
·
3323 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 23ms ·
UTC 11:49
·
PVG 19:49
·
LAX 04:49
·
JFK 07:49
♥ Do have faith in what you're doing.
❯