["python","shell"]
How can I call a shell script from Python code?

How can I call a shell script from Python code?
The subprocess module will help you out. Blatantly trivial example: >>> import subprocess >>> subprocess.call(['sh', './test.sh']) # Thanks @Jim Dennis for suggesting the [] 0 Where test.sh is a simple shell script and 0 is its return value for this run.