Index: Doc/library/subprocess.rst =================================================================== --- Doc/library/subprocess.rst (revision 74670) +++ Doc/library/subprocess.rst (working copy) @@ -495,6 +495,15 @@ stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True) (child_stdin, child_stdout_and_stderr) = (p.stdin, p.stdout) +On Unix, os.popen2, os.popen3, and os.popen4 also accept a list of strings +as the command to execute. This usage can be replaced as follows:: + + (child_stdin, child_stdout) = os.popen2(["/bin/ls", "-l"], mode, bufsize) + ==> + p = Popen(["/bin/ls", "-l"], bufsize=bufsize, stdin=PIPE, stdout=PIPE) + (child_stdin, child_stdout) = (p.stdin, p.stdout) + + Return code handling translates as follows:: pipe = os.popen(cmd, 'w')