On Sat, 21 Jul 2012 16:10:51 -0400, Dave Angel wrote: >> with fileinput.input(files=(filename)) as f: > > fileinput is much more general than you want for processing a single > file. That may be deliberate, if you're picturing somebody using > wildcards on their input. But if so, you should probably use a > different name, something that indicates plural.
Also, fileinput is more a convenience module than a serious production quality tool. It works, it does the job, but it can be slow. From the source: Performance: this module is unfortunately one of the slower ways of processing large numbers of input lines. -- Steven -- http://mail.python.org/mailman/listinfo/python-list