[New-bugs-announce] [issue3235] Improve subprocess module usage

Martin Mokrejs report at bugs.python.org
Sun Jun 29 11:26:14 CEST 2008


New submission from Martin Mokrejs <mmokrejs at users.sourceforge.net>:

Although I do appreciate that you try to improve python it is not clear
to me from http://docs.python.org/lib/module-subprocess.html:

1. Why the old functions have been deprecated
2. I can pipe together two processes. But how can I use pipe to feed the
first process of the two? The example at
http://docs.python.org/lib/node535.html is not sufficient. Show how to
bind together cat(1) and tr(1). Cat should read from STDIN and pass the
same to STDOUT, being read by tr(1).
3. Nowhere is explained what this magic really does:
   output = p2.communicate()[0]
   I figured out the result is e.g. a string of '\n' separated lines.
   What is not clear whether at this very moment the processes get
   started and whether one can still write on input to them. It seems
   not, the p1.stdin has to be already populated with data.
Thanks.

----------
assignee: georg.brandl
components: Documentation
messages: 68943
nosy: georg.brandl, mmokrejs
severity: normal
status: open
title: Improve subprocess module usage
type: resource usage
versions: Python 2.5

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


More information about the New-bugs-announce mailing list