library to do easy shell scripting in Python

alex23 wuwei23 at gmail.com
Thu Apr 24 06:00:47 EDT 2008


On Apr 24, 12:22 pm, Michael Torrie <torr... at gmail.com> wrote:
> pipe([prog1,args],[prog2,args],...)
> Any ideas on how I could design this?

There's a recipe on Activestate's Python Cookbook that does pretty
much this:

> Allows arbitrary number of commands to be strung together with
> each one feeding into the next ones input. Syntax is simple:
> x=pipe("cmd1", "cmd2", "cmd3").read() is equivalent to bash
> command x=`cmd1 | cmd2 | cmd3`.

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475171

I haven't used it myself, but it might make a good place to start.

- alex23




More information about the Python-list mailing list