assigning value to shell variable using a function return value from Python

后端 未结 4 608
耶瑟儿~
耶瑟儿~ 2020-12-06 05:54

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

4条回答
  •  执笔经年
    2020-12-06 06:43

    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.

提交回复
热议问题