Popular recipes by Micah Elliott http://code.activestate.com/recipes/users/2649403/2009-06-10T16:08:13-07:00ActiveState Code RecipesFind the oldest (or yougest) of a list of files (Python) 2009-06-10T16:08:13-07:00Micah Elliotthttp://code.activestate.com/recipes/users/2649403/http://code.activestate.com/recipes/576804-find-the-oldest-or-yougest-of-a-list-of-files/ <p style="color: grey"> Python recipe 576804 by <a href="/recipes/users/2649403/">Micah Elliott</a> (<a href="/recipes/tags/age/">age</a>, <a href="/recipes/tags/files/">files</a>, <a href="/recipes/tags/find/">find</a>, <a href="/recipes/tags/queue/">queue</a>). </p> <p>Sometimes you need to perform an operation on the oldest of a set of files. Using <em>get_oldest_file</em> you could implement an age-based priority queue that processes files from oldest to newest. The list of files you pass in may be from a <em>glob</em> of a single directory or some more elaborate search routine.</p> Generate random user names from local dictionary file (Python) 2008-10-29T06:24:18-07:00Micah Elliotthttp://code.activestate.com/recipes/users/2649403/http://code.activestate.com/recipes/576544-generate-random-user-names-from-local-dictionary-f/ <p style="color: grey"> Python recipe 576544 by <a href="/recipes/users/2649403/">Micah Elliott</a> (<a href="/recipes/tags/testing/">testing</a>, <a href="/recipes/tags/usernames/">usernames</a>). Revision 3. </p> <p>Sometimes for testing purposes you need to fill a database with randomly generated user names. Or maybe you're just offering distinguishable anonymity to users for whatever reason. Or maybe your product needs a codename! This describes a very simple way to get a bunch of "names".</p> Fix ugly file names to be UNIX shell-friendly. (Python) 2005-11-02T07:30:53-08:00Micah Elliotthttp://code.activestate.com/recipes/users/2649403/http://code.activestate.com/recipes/442517-fix-ugly-file-names-to-be-unix-shell-friendly/ <p style="color: grey"> Python recipe 442517 by <a href="/recipes/users/2649403/">Micah Elliott</a> (<a href="/recipes/tags/sysadmin/">sysadmin</a>). </p> <p>You have files named with funky characters lying around in your filesystem. Ugly files like "My Document #3 - (2005)[1].txt" are common when you're sharing directories with Windows users, but you would like to have them renamed to something like "my_document_3_-_2005-1-.txt" so that your shell and other unix utilities won't have to deal with special characters.</p>