I would like to call an external script from within a function, for instance:
import subprocess
def call_script(script):
subprocess.call(script)
return answer #retrieving the result is the part I'm struggling with
call_script("/user/bin/calc_delta.py")
The script calc_delta.py simply prints the result when it is done. How can I assign the result of that script to a variable? Thank you.