How to call a shell script from python code?

You can translate the content of this page by selecting a language in the select box.

This is how to How to call a shell script from python code


import subprocess
subprocess.call(['sh shell_script.sh arguments'])


or




Football/Soccer World Cup 2022 Guide and Past World Cups History and Quiz illustrated


import sys, os
os.system("sh shell_script.sh arguments")

Output Example

error: Content is protected !!