The following code snippet is modified from another website:
from subprocess import Popen, PIPEcmd = "blah blah"process = Popen(cmd.split(), stdout=PIPE)process.communicate() # execute it, the output goes to the stdoutexit_code = process.wait() # when finished, get the exit code
No comments:
Post a Comment