Skip to content

Instantly share code, notes, and snippets.

@devster31
Last active February 21, 2018 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devster31/05ddce6cf388abfff69256ed9f823357 to your computer and use it in GitHub Desktop.
Save devster31/05ddce6cf388abfff69256ed9f823357 to your computer and use it in GitHub Desktop.
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