Popular recipes by Paul Moore http://code.activestate.com/recipes/users/1826654/2007-11-28T05:29:11-08:00ActiveState Code RecipesConsole progress dots using threads and a context manager (Python) 2007-11-28T05:29:11-08:00Paul Moorehttp://code.activestate.com/recipes/users/1826654/http://code.activestate.com/recipes/535141-console-progress-dots-using-threads-and-a-context-/ <p style="color: grey"> Python recipe 535141 by <a href="/recipes/users/1826654/">Paul Moore</a> (<a href="/recipes/tags/threads/">threads</a>). </p> <p>When executing a long running task, it is often useful to provide some feedback to the user. In a console program, this often consists of text such as "Running...." where a dot is printed (say) each second.</p> <p>Adding a progress indicator like this to existing code can be tricky, but with threads and a context manager, it's easy.</p> Summary reports using itertools.groupby (Python) 2004-09-10T13:20:37-07:00Paul Moorehttp://code.activestate.com/recipes/users/1826654/http://code.activestate.com/recipes/304162-summary-reports-using-itertoolsgroupby/ <p style="color: grey"> Python recipe 304162 by <a href="/recipes/users/1826654/">Paul Moore</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). Revision 2. </p> <p>Lists of data grouped by a key value are common - obvious examples are spreadsheets or other tabular arrangements of information. In many cases, the new itertools groupby function introduced in Python 2.4 can provide a means of easily generating summaries of such information.</p>