Call Python script from bash with argument

前端 未结 8 856
长发绾君心
长发绾君心 2020-11-29 16:37

I know that I can run a python script from my bash script using the following:

python python_script.py

But what about if I wanted to pass a

8条回答
  •  执笔经年
    2020-11-29 17:14

    use in the script:

    echo $(python python_script.py arg1 arg2) > /dev/null
    

    or

    python python_script.py "string arg"  > /dev/null
    

    The script will be executed without output.

提交回复
热议问题