[issue3548] subprocess.pipe function

Anh Hai Trinh report at bugs.python.org
Mon Aug 23 10:53:42 CEST 2010


Anh Hai Trinh <anh.hai.trinh at gmail.com> added the comment:

I've written a package which can do this with arbitrary redirection in all subcommands (and some more).

You can, for example, do this:

    >>> Pipe(Sh('echo -n foo >&2', {2: 1}), Sh('cat; echo ERROR >&2', {2: os.devnull})).capture(1).read()
    'foo'

The package is at: http://github.com/aht/pc.py

----------
nosy: +aht

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3548>
_______________________________________


More information about the Python-bugs-list mailing list