Hello,
I have a model written in python which basically looks like this :
import sys
param1 = float(sys.argv[1])
param2 = float(sys.argv[2])
pyResult = param1 + param2
and I simply want to store pyResult in an Open Mole variable as a float so I can run a Replication task on the CARETask, get the mean and variance of them, and so on.
The OpenMole script looks like :
val param1 = Val[Double]
val param2 = Val[Double]
val OMresult = Val[Double]
val makeAsum =
CARETask(“sumTask.tgz.bin”, "python sumTask.py ${param1} ${param2}) set (
< Some Missing Code>
param1 := 5.0,
param2 := 1.0
)
makeAsum hook ToStringHook()
How can I put pyResult
from the python script in the Open Mole variable OMresult
?
Can I cast the stdout of the python script in a float for instance or is it mandatory to write the output of the model in a file as shown in the Native Application Tutorial from the Market Place ?