Popular recipes by Richard Philips http://code.activestate.com/recipes/users/98125/2006-10-25T12:09:30-07:00ActiveState Code RecipesQuote python strings for safe use in POSIX shells (Python) 2006-10-16T10:30:58-07:00Richard Philipshttp://code.activestate.com/recipes/users/98125/http://code.activestate.com/recipes/498202-quote-python-strings-for-safe-use-in-posix-shells/ <p style="color: grey"> Python recipe 498202 by <a href="/recipes/users/98125/">Richard Philips</a> (<a href="/recipes/tags/programs/">programs</a>). </p> <p>Often one has to quote a python string so that the result can be used as an argument to a command running in a POSIX shell.</p> <p>The function QuoteForPOSIX can be used with sh, bash, csh, ksh</p> Converts a DOM node object of type element to an ElementTree Element (Python) 2006-10-25T12:09:30-07:00Richard Philipshttp://code.activestate.com/recipes/users/98125/http://code.activestate.com/recipes/498221-converts-a-dom-node-object-of-type-element-to-an-e/ <p style="color: grey"> Python recipe 498221 by <a href="/recipes/users/98125/">Richard Philips</a> (<a href="/recipes/tags/xml/">xml</a>). </p> <p>DOM2ET is a simple python function which converts a DOM node object of type element to an ElementTree Element. &lt;br&gt; Writing it, was a good exercise to understand the workings of ElementTree</p> Launching a subprocess without a console window (Python) 2005-04-07T06:58:05-07:00Richard Philipshttp://code.activestate.com/recipes/users/98125/http://code.activestate.com/recipes/409002-launching-a-subprocess-without-a-console-window/ <p style="color: grey"> Python recipe 409002 by <a href="/recipes/users/98125/">Richard Philips</a> . </p> <p>On the MS Windows platform, if you launch a subprocess from within a non-console process a console window appears.</p> <p>This recipe shows how to avoid this by using the python 2.4 library module subprocess.py</p> Checks for a valid POSIX filename (Python) 2005-06-01T02:09:52-07:00Richard Philipshttp://code.activestate.com/recipes/users/98125/http://code.activestate.com/recipes/415680-checks-for-a-valid-posix-filename/ <p style="color: grey"> Python recipe 415680 by <a href="/recipes/users/98125/">Richard Philips</a> (<a href="/recipes/tags/files/">files</a>). </p> <p>Oneliner to check for valid POSIX filenames</p> Dicts from lists (Python) 2003-11-28T03:09:30-08:00Richard Philipshttp://code.activestate.com/recipes/users/98125/http://code.activestate.com/recipes/252176-dicts-from-lists/ <p style="color: grey"> Python recipe 252176 by <a href="/recipes/users/98125/">Richard Philips</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). </p> <p>Simple oneliner to built a dictionary from a list</p> Obtaining the name of a function/method (Python) 2001-03-28T04:30:24-08:00Richard Philipshttp://code.activestate.com/recipes/users/98125/http://code.activestate.com/recipes/52315-obtaining-the-name-of-a-functionmethod/ <p style="color: grey"> Python recipe 52315 by <a href="/recipes/users/98125/">Richard Philips</a> (<a href="/recipes/tags/programs/">programs</a>). </p> <p>How to obtain the name of a method or a function from within the running method/function.</p> <p>Acknowledgement: the solution to this problem is given by Christian Tismer (tismer@tismer.com; Mission Impossible 5oftware)</p>