Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to capture cmd output in python

from subprocess import Popen, PIPE
path = "echo"
pipe = Popen(path, stdout=PIPE)
text, err = pipe.communicate()
if(pipe.returncode==0)
print( text, err)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #capture #cmd #output #python
ADD COMMENT
Topic
Name
9+7 =