Python BeanShell中exec的变量扩展

Python BeanShell中exec的变量扩展,python,exec,Python,Exec,我的beanshell脚本如下所示,其中我调用exec来执行python脚本 String param="parameter1"; Runtime r = Runtime.getRuntime(); Process p = r.exec("/usr/bin/python /path/script.py param"); 在python脚本中,第一个参数是“param”,而不是“parameter1”。问题是如何将param的值传递给python脚本。您尝试过这种方法吗 String param

我的beanshell脚本如下所示,其中我调用exec来执行python脚本

String param="parameter1";
Runtime r = Runtime.getRuntime();
Process p = r.exec("/usr/bin/python /path/script.py param");
在python脚本中,第一个参数是“param”,而不是“parameter1”。问题是如何将param的值传递给python脚本。

您尝试过这种方法吗

String param="parameter1";
Runtime r = Runtime.getRuntime();
Process p = r.exec("/usr/bin/python /path/script.py " + param);