我有一个需要从groovy脚本调用/执行python脚本的情况。我怎么能做到呢?在
下面是我用groovy编写的执行python脚本的代码
def task = ["/Users/amiteshshukla/Documents/Work/PythonTest/Test.py"]
def executeTask = task.execute()
executeTask.waitForOrKill(1000)
println (executeTask.text)
这是我试图通过groovy执行的python代码示例
^{pr2}$当我执行groovy脚本时,我希望得到以下输出: “****我的名字是阿米蒂什****”
但是,我得到了这个输出。在
task = ["/Users/amiteshshukla/Documents/Work/PythonTest/Test.py"]
executeTask = task.execute()
executeTask.waitForOrKill(1000)
println(text)
在python脚本中添加shebang行。这样操作系统就知道它需要通过python解释器调用脚本。在
相关问题 更多 >
编程相关推荐