Python - subprocess.popen从Java应用程序获得零输出,只停在“对象在0x02AXXX处”

2024-04-26 06:51:34 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图从python运行一个简单的helloworld java程序,但是它不知怎么地停止了

<subprocess.Popen object at 0x02A5FC10>
>>>   no out put here ??

我也试过了

^{pr2}$

>>> import subprocess >>> p = subprocess.Popen(["C:\\Users\\Chamarthy\\Desktop\\work\\arrayproject\\src\\arrayproject\\hello.Main", "MyClass"], stdout=subprocess.PIPE, shell=True) >>> print (p) <subprocess.Popen object at 0x02A5FC10> >>>

package arrayproject; public class hello { public static void main(String[] args) { System.out.println("Hello World!" + args[0]); } }


Tags: no程序hellohereobjectputargsjava