Returning Values from Bash Scripts

Tim Roberts timr at
Sun Jan 8 03:57:01 EST 2006

chakkaradeepcc at wrote:
>How to execute bash scripts from python (other than using os.popen) and
>get the values that those bash scripts return.

Why would you eliminate os.popen?  It is precisely the right way to do
this.  That's the same interface bash itself uses to execute scripts.

That is, assuming by "values" you mean the stdout from the script.  If you
really mean the numerical return code, you can use os.system.
- Tim Roberts, timr at
  Providenza & Boekelheide, Inc.

More information about the Python-list mailing list