I have a python script calculate.py with a function in it like below
def mytest():
Y_pred = {}
Y_pred['a'] = [1,2,3]
Y_pred['b'] = [45,54,77]
return Y_pred
Now from python console I want to run the python script using subprocess and get the return value `Y_pred' into a variable. So I want something like the pseudocode below from the terminal
python3
>>> import subprocess
>>> returned_val = subprocess.call([run calculate.py here and call mytest() ])
In the end, I want the returned value of mytest() to a variable returned_val.