This is because subprocess.call returns int:
subprocess.call(args, *, stdin=None, stdout=None, stderr=None, shell=False) Run the command described by args. Wait for command to complete, then return the returncode attribute.
It looks like you want subprocess.Popen ().
Here is a typical piece of code that I should do:
p = Popen(cmd, stdout=PIPE, stderr=PIPE, bufsize=256*1024*1024) output, errors = p.communicate() if p.returncode: raise Exception(errors) else: # Print stdout from cmd call print output
source share