Call a bash script with arguments in python

tzoo.py

/tmp/hoo.py
arguments=" ".join(["foo", "bar"])
cmd="foo.sh"
subprocess.run(['/bin/env', cmd]+arguments)

loo.sh:

~/la.sh
#!/bin/sh
for arg in "$@"; do
    echo $arg
done

Now calling python foo.py calls foo.sh with arguments.

Mind possible offtopic tasks like chmod +x, permissions etc.

Source