Last active
February 21, 2018 17:45
-
-
Save devster31/05ddce6cf388abfff69256ed9f823357 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import Popen, PIPE | |
def run_command(): | |
with Popen(['pp3.py'], stdout=PIPE, stderr=PIPE, bufsize=1, universal_newlines=True) as p: | |
while p.poll() is None: | |
out = p.stdout.readline() | |
err = p.stderr.readline() | |
print(out, end='') | |
print(err, end='') | |
if __name__ == "__main__": | |
run_command() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment