java调用python程序问题
1个回答
展开全部
String s;
Process process = Runtime.getRuntime().exec("/usr/bin/python my.py");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream());
while((s=bufferedReader.readLine()) != null) {
System.out.println(s);
}
process.waitfor();
Process process = Runtime.getRuntime().exec("/usr/bin/python my.py");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream());
while((s=bufferedReader.readLine()) != null) {
System.out.println(s);
}
process.waitfor();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询