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)
| 685 | return exitcode, data |
| 686 | |
| 687 | def getoutput(cmd, *, encoding=None, errors=None): |
| 688 | """Return output (stdout or stderr) of executing cmd in a shell. |
| 689 | |
| 690 | Like getstatusoutput(), except the exit status is ignored and the return |
| 691 | value is a string containing the command's output. Example: |
| 692 | |
| 693 | >>> import subprocess |
| 694 | >>> subprocess.getoutput('ls /bin/ls') |
| 695 | '/bin/ls' |
| 696 | """ |
| 697 | return getstatusoutput(cmd, encoding=encoding, errors=errors)[1] |
| 698 | |
| 699 | |
| 700 |
nothing calls this directly
no test coverage detected
searching dependent graphs…