On Wed, Aug 22, 2012 at 8:28 PM, Kamil Kuduk <kamil.ku...@gmail.com> wrote: >> Purpose of the script: >> To capitalize the first letter of any word in a given file, leaving >> words which have 3 or less letters. > > First or all? If first and this is the only purpose of the script you > can easily use sed: > less file.txt | sed -e "s/\b\([a-z]\{4,\}\)/\u\1/g"
Why less? Why not just redirect input? Though, this isn't really on topic for Python. ChrisA -- http://mail.python.org/mailman/listinfo/python-list