Popular recipes by Christopher Prinos http://code.activestate.com/recipes/users/481494/2010-02-10T10:47:53-08:00ActiveState Code RecipesUse DebugView utility with standard python logging (Python) 2010-02-10T10:35:59-08:00Christopher Prinoshttp://code.activestate.com/recipes/users/481494/http://code.activestate.com/recipes/577040-use-debugview-utility-with-standard-python-logging/ <p style="color: grey"> Python recipe 577040 by <a href="/recipes/users/481494/">Christopher Prinos</a> (<a href="/recipes/tags/debugging/">debugging</a>, <a href="/recipes/tags/debugview/">debugview</a>, <a href="/recipes/tags/logging/">logging</a>, <a href="/recipes/tags/sysinternals/">sysinternals</a>, <a href="/recipes/tags/windows/">windows</a>). </p> <p>This is a custom logging.Handler class that lets you use standard logging calls to output messages to SysInternals' DebugView utility.</p> Use generators for fetching large db record sets (Python) 2010-02-10T10:47:53-08:00Christopher Prinoshttp://code.activestate.com/recipes/users/481494/http://code.activestate.com/recipes/137270-use-generators-for-fetching-large-db-record-sets/ <p style="color: grey"> Python recipe 137270 by <a href="/recipes/users/481494/">Christopher Prinos</a> (<a href="/recipes/tags/database/">database</a>). Revision 5. </p> <p>When using the python DB API, it's tempting to always use a cursor's fetchall() method so that you can easily iterate through a result set. For very large result sets though, this could be expensive in terms of memory (and time to wait for the entire result set to come back). You can use fetchmany() instead, but then have to manage looping through the intemediate result sets. Here's a generator that simplifies that for you.</p>