Returning Values from Bash Scripts
fredrik at pythonware.com
Sun Jan 8 21:58:12 CET 2006
Steven D'Aprano wrote:
> >> How to execute bash scripts from python (other than using os.popen) and
> >> get the values that those bash scripts return.
> > The easy way is to call it with subprocess.call.
> >>> import subprocess
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> ImportError: No module named subprocess
> It might be easy, but an awful lot of people won't be using a version of
> Python that has the subprocess module, and for them upgrading may not be
> easy (or even possible) at all.
subprocess is available as a separate distribution for Python 2.2
if you're on a unixoid system, all you need is the subprocess.py
file, which you can also get directly from the Python SVN:
More information about the Python-list