【发布时间】:2014-12-15 04:34:05
【问题描述】:
我正在尝试将运行并将参数传递给 python 程序,但遇到了麻烦。 这是我现在正在做的事情:
String[] testCases=readIn("C:\\xampp\\htdocs\\development\\"+folder+"\\testCases.txt");
String arguements="";
for(int i=0; i<testCases.length; i++)
{
if(i==0)
{
arguements=testCases[i]+" ";
}
else
{
arguements=arguements+testCases[i]+" ";
}
command= new String[]{"C:\\Python27\\python.exe","C:\\xampp\\htdocs\\development\\"+fileName, arguements};
Process process=Runtime.getRuntime().exec(command);
我很确定我正确地传递了参数。我需要用某种方式表明它们是我的 Python 代码将使用的参数吗?
【问题讨论】:
标签: java python parameter-passing