############################################################################# # # printwords.py # # Jeff Ondich, 1/10/07 # # This program uses the "words" module to print a list of all the words # in the file passed to standard input. Run this program from the # command line like so: # # python printwords.py < somefile.txt # # to print the words contained in somefile.txt. You need to make sure # that words.py is in the same directory as printwords.py before you # run the program (otherwise, the "import" statement will fail). # ############################################################################# import words w = words.getword() while len(w) > 0: print w w = words.getword()