Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

subprocess print logs

from subprocess import Popen, PIPE, STDOUT

command = "shell command with arguments"
process = Popen(command, shell=True, stdout=PIPE, stderr=STDOUT)

with process.stdout:
    for line in iter(process.stdout.readline, b''):
        print(line.decode("utf-8").strip())
 
PREVIOUS NEXT
Tagged: #subprocess #print #logs
ADD COMMENT
Topic
Name
8+8 =