Reputation: 3745
This question and answer demonstrates how to use Python's subprocess
module to interact with bash
from Python.
So if subprocess
doesn't use the system's default shell, then what shell does it use to run commands like this:
import subprocess
print subprocess.check_output(["ls", "-la"])
Upvotes: 3
Views: 415
Reputation: 24089
If shell
is not passed as a keyword argument it uses fork_exec
, or _winapi.CreateProceess
If shell=True
:
/bin/sh
, .cmd.exe
.See:
Upvotes: 3