Popular recipes by Lonnie Princehouse http://code.activestate.com/recipes/users/2071987/2006-07-13T15:52:59-07:00ActiveState Code RecipesString Interpolation with Evaluation of Embedded Expressions (Python) 2006-07-13T15:52:59-07:00Lonnie Princehousehttp://code.activestate.com/recipes/users/2071987/http://code.activestate.com/recipes/496885-string-interpolation-with-evaluation-of-embedded-e/ <p style="color: grey"> Python recipe 496885 by <a href="/recipes/users/2071987/">Lonnie Princehouse</a> (<a href="/recipes/tags/text/">text</a>). </p> <p>A lightweight and powerful way to evaluate expressions embedded in strings during interpolation.</p> Automatic indentation of output based on frame stack (Python) 2005-04-26T13:27:42-07:00Lonnie Princehousehttp://code.activestate.com/recipes/users/2071987/http://code.activestate.com/recipes/411791-automatic-indentation-of-output-based-on-frame-sta/ <p style="color: grey"> Python recipe 411791 by <a href="/recipes/users/2071987/">Lonnie Princehouse</a> (<a href="/recipes/tags/debugging/">debugging</a>). </p> <p>Output stream wrapper; possibly useful for debugging code with print statements.</p> <p>When write() is called, it makes a note of the calling frame. The indentation level is equal to the number of frames in the call stack which have been previously noted. See example.</p> Self-updating pickles, based on CVS revision string (Python) 2004-11-16T11:39:03-08:00Lonnie Princehousehttp://code.activestate.com/recipes/users/2071987/http://code.activestate.com/recipes/335816-self-updating-pickles-based-on-cvs-revision-string/ <p style="color: grey"> Python recipe 335816 by <a href="/recipes/users/2071987/">Lonnie Princehouse</a> . </p> <p>One of the problems with persistent objects is that one often needs a mechanism to keep them in sync with the codebase. This provides such a mechanism for pickled objects under the control of CVS via the magic CVS $Revision$ string, which CVS will automatically update to match a file's revision number.</p> skeletal compiler.visitor.ASTVisitor generator (Python) 2004-10-19T19:11:51-07:00Lonnie Princehousehttp://code.activestate.com/recipes/users/2071987/http://code.activestate.com/recipes/310790-skeletal-compilervisitorastvisitor-generator/ <p style="color: grey"> Python recipe 310790 by <a href="/recipes/users/2071987/">Lonnie Princehouse</a> (<a href="/recipes/tags/oop/">oop</a>). Revision 2. </p> <p>Parse the online documentation for compiler.ast and generate code for a skeletal ASTVisitor class that includes stubs for all of the various visitNODE functions you might need in a visitor, along with comments in each function that list that node type's attributes.</p> skeletal compiler.visitor.ASTVisitor (Python) 2004-10-19T12:18:14-07:00Lonnie Princehousehttp://code.activestate.com/recipes/users/2071987/http://code.activestate.com/recipes/310791-skeletal-compilervisitorastvisitor/ <p style="color: grey"> Python recipe 310791 by <a href="/recipes/users/2071987/">Lonnie Princehouse</a> (<a href="/recipes/tags/oop/">oop</a>). </p> <p>ASTVisitor with stub functions for all of the ast.Node types list in the compiler.ast documentation, with comments describing Node attributes.</p>