Created
January 14, 2010 20:23
-
-
Save russelnickson/277468 to your computer and use it in GitHub Desktop.
count words
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import shlex | |
f=open(sys.argv[1]) | |
content=f.read() | |
words=shlex.split(content) | |
print 'word count = '+ str(len(words)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment