Message400565
The documentation states that "[i]f capture_output is true, stdout and stderr will be captured". This implies a container of some kind. So look to what subprocess.run() returns: "[w]ait for command to complete, then return a CompletedProcess instance". The `stdout` attribute of a CompletedProcess is the "[c]aptured stdout from the child process".
For example:
>>> p = subprocess.run("dir", shell=True, capture_output=True)
>>> p.stdout[:18]
b' Volume in drive C'
If the output is not captured, the child process inherits the standard output/error files of the parent process, which is typically a console or terminal.
FYI, the `dir` command is internal to the CMD shell in Windows, so it only works with shell=True. There is no "dir.exe" executable that can be executed with shell=False. |
|
Date |
User |
Action |
Args |
2021-08-29 22:50:18 | eryksun | set | recipients:
+ eryksun, veky, deleted-user-7BsjxvvFYDdTwO8F |
2021-08-29 22:50:18 | eryksun | set | messageid: <1630277418.16.0.729633870024.issue45048@roundup.psfhosted.org> |
2021-08-29 22:50:18 | eryksun | link | issue45048 messages |
2021-08-29 22:50:18 | eryksun | create | |
|