yuliji
7/7/2017 - 10:02 AM

external command, get output, shell

external command, get output, shell

try:
  out_bytes = subprocess.check_output(['cmd', 'arg1', 'arg2'])
except subprocess.CalledProcessError as e:
  out_bytes = e.output
  code = e.returncode