Groovy调用python脚本

def cmd = "python /tmp/xxx/xxx.py"

try {

def proc = ["/bin/sh","-c",cmd].execute()

proc.waitFor()

println proc.in.text

} catch(Exception e) {

println e

}

Groovy将字符串转成数组

def str = ‘[1,2,3]’

def val = Eval.me(str)