Skip to content

Instantly share code, notes, and snippets.

@methane
Created December 15, 2009 09:08
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 methane/256792 to your computer and use it in GitHub Desktop.
Save methane/256792 to your computer and use it in GitHub Desktop.
import sys
lines = words = bytes = 0
for L in sys.stdin:
bytes += len(L)
words += len(L.split())
lines += 1
print 'bytes', bytes
print 'words', words
print 'lines', lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment