Message146095
From a quick look it seems to me that only
- output = Popen(["mycmd", "myarg"], stdout=PIPE).communicate()[0]
+ output = check_output(["mycmd", "myarg"])
can be changed.
Most of the other example access attributes of the Popen objects, such as stdin/stdout. subprocess.call is already used in a few places.
Another thing that I wanted to fix for a while is the syntax highlight in these examples. Using '# becomes' instead of '==>' solves the problem for most of the examples, except for the first two that use `...`. Using two separate blocks is another option. A table with two columns (before/after) might also work, but it's difficult to get it wide enough to contain both the examples side by side.
About moving the convenience functions first, I'm not sure it works too well.
"This module defines one class called Popen:"
could be replaced by
"This module defines a class called Popen, and the convenience functions call(), check_call(), and check_output():"
where the three functions and possibly 'convenience functions' link to to the part of the page where they are defined. |
|
Date |
User |
Action |
Args |
2011-10-21 15:23:02 | ezio.melotti | set | recipients:
+ ezio.melotti, rhettinger, ncoghlan, flox, docs@python |
2011-10-21 15:23:02 | ezio.melotti | set | messageid: <1319210582.34.0.519230865524.issue13237@psf.upfronthosting.co.za> |
2011-10-21 15:23:01 | ezio.melotti | link | issue13237 messages |
2011-10-21 15:23:01 | ezio.melotti | create | |
|