Popular recipes by Tom Good http://code.activestate.com/recipes/users/98560/2002-01-05T01:01:38-08:00ActiveState Code RecipesWalk a directory tree using a generator (Python) 2002-01-05T01:01:38-08:00Tom Goodhttp://code.activestate.com/recipes/users/98560/http://code.activestate.com/recipes/105873-walk-a-directory-tree-using-a-generator/ <p style="color: grey"> Python recipe 105873 by <a href="/recipes/users/98560/">Tom Good</a> . Revision 2. </p> <p>This is a new implementation of directory walking inspired by Fredrik Lundh's directoryWalker.py (see <a href="http://aspn.activestate.com/ASPN/Mail/Message/541112" rel="nofollow">http://aspn.activestate.com/ASPN/Mail/Message/541112</a> ). This code uses a generator instead of a class, so it requires Python 2.2 or above.</p> wrap unbounded generator to restrict its output (Python) 2001-07-25T16:01:55-07:00Tom Goodhttp://code.activestate.com/recipes/users/98560/http://code.activestate.com/recipes/66427-wrap-unbounded-generator-to-restrict-its-output/ <p style="color: grey"> Python recipe 66427 by <a href="/recipes/users/98560/">Tom Good</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). </p> <p>With Python 2.2+, you can make generators that return unbounded output. By creating a "wrapper" generator that runs the first generator, you can restrict its output to some defined subset.</p> Changing the indentation of a multi line string (Python) 2001-07-13T15:25:38-07:00Tom Goodhttp://code.activestate.com/recipes/users/98560/http://code.activestate.com/recipes/66055-changing-the-indentation-of-a-multi-line-string/ <p style="color: grey"> Python recipe 66055 by <a href="/recipes/users/98560/">Tom Good</a> (<a href="/recipes/tags/text/">text</a>). </p> Fibonacci sequence using generators (Python) 2001-07-23T11:31:20-07:00Tom Goodhttp://code.activestate.com/recipes/users/98560/http://code.activestate.com/recipes/66316-fibonacci-sequence-using-generators/ <p style="color: grey"> Python recipe 66316 by <a href="/recipes/users/98560/">Tom Good</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). </p> <p>Generators, introduced in Python 2.2, can be used to work with infinite sets. Here is a simple example of a generator that creates the Fibonacci sequence.</p>