Passing python array to bash script (and passing bash variable to python function)

后端 未结 5 764
感情败类
感情败类 2021-01-02 16:27

I have written a Python module which contains functions that return arrays. I want to be able to access the string arrays returned from the python module, and iterate over i

5条回答
  •  Happy的楠姐
    2021-01-02 16:39

    In lieu of something like object serialization, perhaps one way is to print a list of comma separated values and pipe them from the command line.

    Then you can do something like:

    > python script.py | sh shellscript.sh
    

提交回复
热议问题