Return (standard output, standard error) of executing cmd in a shell. Accepts the same arguments as os.system(). Parameters ---------- cmd : str or list A command to be executed in the system shell. Returns ------- stdout : str stderr : str
(cmd)
| 134 | |
| 135 | |
| 136 | def getoutputerror(cmd): |
| 137 | """Return (standard output, standard error) of executing cmd in a shell. |
| 138 | |
| 139 | Accepts the same arguments as os.system(). |
| 140 | |
| 141 | Parameters |
| 142 | ---------- |
| 143 | cmd : str or list |
| 144 | A command to be executed in the system shell. |
| 145 | |
| 146 | Returns |
| 147 | ------- |
| 148 | stdout : str |
| 149 | stderr : str |
| 150 | """ |
| 151 | return get_output_error_code(cmd)[:2] |
| 152 | |
| 153 | def get_output_error_code(cmd): |
| 154 | """Return (standard output, standard error, return code) of executing cmd |