> The example from the code is: > > p1 = Popen(["dmesg"], stdout=PIPE) > p2 = Popen(["grep", "hda"], stdin=p1.fromchild) > result = p2.communicate()[0] > > Some things immediately spring from this: > > 1. stdout=PIPE doesn't feel like it adds anything. It's "obvious" that > I want a pipe. But of course there's no way the code realises that > unless I say so. > 2. fromchild doesn't look too nice. I'd prefer to use "stdin=p1.stdout". You too? :-) I'm almost convinced now that we should really drop this popen2 syntax... > 3. communicate() doesn't really describe what it does very well. Give me some other alternatives... > Maybe inverting the sense of the argument, and saying pipe=STDOUT, or in > the case of multiple pipes, pipe=(STDIN, STDOUT), is better. What do > people think? I think this is worse than the current syntax. > PS If this becomes a design discussion, is python-dev (or even python-list) > appropriate? Would it be better to set up a SIG for this, much like > optparse had the getopt-sig for a while? If there's interest, I can arrange a mailing list in matter of minutes. -- /Peter Åstrand <astrand at lysator.liu.se>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4