Skip to content

Instantly share code, notes, and snippets.

@tonetheman
Created February 24, 2009 16:37
Show Gist options
  • Save tonetheman/69652 to your computer and use it in GitHub Desktop.
Save tonetheman/69652 to your computer and use it in GitHub Desktop.
read a pipe in python
import sys
while True:
next_line = sys.stdin.readline()
if not next_line:
break
# do something to the line
next_line = next_line.strip()
print next_line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment