Skip to content

Instantly share code, notes, and snippets.

@zeromodule
Created December 25, 2015 15:13
Show Gist options
  • Save zeromodule/aa93521bbf5e8c5f2c48 to your computer and use it in GitHub Desktop.
Save zeromodule/aa93521bbf5e8c5f2c48 to your computer and use it in GitHub Desktop.
vagrant@vagrant-ubuntu-trusty-64:~$ cat sub.py
from subprocess import Popen, PIPE, STDOUT
sub_process = Popen('ls -la', shell=True, bufsize=0)
while sub_process.poll() is None and sub_process.stdout is not None:
print sub_process.stdout.readline()
print "End"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment