subprocess
program = ['program-name', 'arguments']
result = subprocess.run(program, stdout=subprocess.PIPE, input=out.encode('utf-8') )
if result.returncode == 0:
print("program ran successfully")
subprocess.run()
return a object with following propertiesstdout
- string with the outputreturncode
- return code of the programresult.stdout.decode('utf-8')
- decode the stdout