Simple Script That Counts the Words in sys.stdin : Standard Read « Development « Python
- Python
- Development
- Standard Read
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
Related examples in the same category