Simple Script That Counts the Words in sys.stdin
import sys text = sys.stdin.read() words = text.split() wordcount = len(words) print 'Wordcount:' print wordcount