I have a Python function, fooPy() that returns some value. ( int / double or string)
I want to use this value and assign it in a shell script. For example following
You should print the value returned by fooPy. The shell substitution reads from stdout. Replace the last line of your program with print fooPy() and then use the second shell pipeline you've mentioned. It should work.
print
fooPy
print fooPy()