Return output (stdout or stderr) of executing cmd in a shell. Like getstatusoutput(), except the exit status is ignored and the return value is a string containing the command's output. Example: >>> import subprocess >>> subprocess.getoutput('ls /bin/ls') '/bin/ls'
(cmd, *, encoding=None, errors=None)
| 679 | return exitcode, data |
| 680 | |
| 681 | def getoutput(cmd, *, encoding=None, errors=None): |
| 682 | """Return output (stdout or stderr) of executing cmd in a shell. |
| 683 | |
| 684 | Like getstatusoutput(), except the exit status is ignored and the return |
| 685 | value is a string containing the command's output. Example: |
| 686 | |
| 687 | >>> import subprocess |
| 688 | >>> subprocess.getoutput('ls /bin/ls') |
| 689 | '/bin/ls' |
| 690 | """ |
| 691 | return getstatusoutput(cmd, encoding=encoding, errors=errors)[1] |
| 692 | |
| 693 | |
| 694 |
nothing calls this directly
no test coverage detected