Popular Python recipes tagged "for_loop"http://code.activestate.com/recipes/langs/python/tags/for_loop/2013-08-31T08:14:10-07:00ActiveState Code RecipesDynamically format a comment block (Python)
2013-08-31T08:14:10-07:00Michael Swartzhttp://code.activestate.com/recipes/users/4187428/http://code.activestate.com/recipes/578624-dynamically-format-a-comment-block/
<p style="color: grey">
Python
recipe 578624
by <a href="/recipes/users/4187428/">Michael Swartz</a>
(<a href="/recipes/tags/comments/">comments</a>, <a href="/recipes/tags/for_loop/">for_loop</a>, <a href="/recipes/tags/list/">list</a>).
Revision 3.
</p>
<p>Neatly format a comment block that is surrounded by #s and takes into account right side space padding.</p>
Recursive function to replace nested for loops (cartesian product) (Python)
2010-10-01T00:40:26-07:00Kieranhttp://code.activestate.com/recipes/users/4175132/http://code.activestate.com/recipes/577415-recursive-function-to-replace-nested-for-loops-car/
<p style="color: grey">
Python
recipe 577415
by <a href="/recipes/users/4175132/">Kieran</a>
(<a href="/recipes/tags/cartesian_product/">cartesian_product</a>, <a href="/recipes/tags/code/">code</a>, <a href="/recipes/tags/for_loop/">for_loop</a>, <a href="/recipes/tags/python/">python</a>).
Revision 3.
</p>
<p>Same functionality as the itertools product method (<a href="http://docs.python.org/library/itertools.html#itertools.product" rel="nofollow">http://docs.python.org/library/itertools.html#itertools.product</a>) with one major difference: generators are executed as the loop executes. An itertools product causes all the variables to be collected before the loop actually starts looping.</p>