In the file job.sh, put this
#!/bin/sh
python python_script.py
Execute this command to make the script runnable for you : chmod u+x job.sh
Run it : ./job.sh
import subprocess
output = subprocess.check_output('pidstat -p ALL'.split(' '), stderr=subprocess.STDOUT, universal_newlines=True)
print(output)
#!/bin/sh
python python_script.py
import subprocess
subprocess.call(["./shell.sh"])
# Make sure that "shell.sh" has "+x" permissions