http://www.dabeaz.com/generators/
(PDF presentation "inside")
Quoting:
"This tutorial discusses various techniques for using generator functions and generator expressions in the context of systems [read: command line script] programming. This topic loosely includes files, file systems, text parsing, network programming, and programming with threads."
Example source code in the link above (Python).