Skip to content

Instantly share code, notes, and snippets.

@russelnickson
Created January 14, 2010 20:46
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 russelnickson/277490 to your computer and use it in GitHub Desktop.
Save russelnickson/277490 to your computer and use it in GitHub Desktop.
parse words... my creation... yea..
import sys
import shlex
import string
f=open(sys.argv[1])
content=f.read()
sen=string.split(content,'.')
print sen
words=[]
for i in range(len(sen)):
w=shlex.split(sen[i])
words=words+w
print 'word count = '+ str(len(words))
print words
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment