Call Python script from bash with argument

前端 未结 8 857
长发绾君心
长发绾君心 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:15

    Print all args without the filename:

    for i in range(1, len(sys.argv)):
    print(sys.argv[i])
    

提交回复
热议问题