Skip to content

Instantly share code, notes, and snippets.

@emptyhua
Created October 25, 2013 09:03
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 emptyhua/7151798 to your computer and use it in GitHub Desktop.
Save emptyhua/7151798 to your computer and use it in GitHub Desktop.
subprocess readline
import subprocess
ping = subprocess.Popen(['ping', 'www.taobao.com'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
for line in iter(ping.stdout.readline, ''):
print line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment