Popular recipes tagged "configuration"http://code.activestate.com/recipes/tags/configuration/popular/2016-06-12T15:27:59-07:00ActiveState Code RecipesDrive which Python functions are executed via a text file (Python) 2016-06-12T15:27:59-07:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580681-drive-which-python-functions-are-executed-via-a-te/ <p style="color: grey"> Python recipe 580681 by <a href="/recipes/users/4173351/">Vasudev Ram</a> (<a href="/recipes/tags/adapter/">adapter</a>, <a href="/recipes/tags/configuration/">configuration</a>, <a href="/recipes/tags/dynamic/">dynamic</a>, <a href="/recipes/tags/dynamic_method/">dynamic_method</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/runtime/">runtime</a>). </p> <p>This recipe shows a simple way of externally controlling which Python functions (out out of some) in your program get executed. The control is done at run time, so no code changes to the program are needed, for different choices. The control is done using a text file.</p> Set the logging level to every logger (Python) 2015-10-28T23:16:26-07:00Tim McNamarahttp://code.activestate.com/recipes/users/4193044/http://code.activestate.com/recipes/579119-set-the-logging-level-to-every-logger/ <p style="color: grey"> Python recipe 579119 by <a href="/recipes/users/4193044/">Tim McNamara</a> (<a href="/recipes/tags/configuration/">configuration</a>, <a href="/recipes/tags/logging/">logging</a>). </p> <p>Python's logging allocates a name to every logger. That makes it hard to do something like, setting everything to <code>logging.ERROR</code>. Here's one way you might go about that:</p> PyDON - An alternative to XML (Python) 2010-12-24T08:28:15-08:00Lost Protocolhttp://code.activestate.com/recipes/users/4176279/http://code.activestate.com/recipes/577508-pydon-an-alternative-to-xml/ <p style="color: grey"> Python recipe 577508 by <a href="/recipes/users/4176279/">Lost Protocol</a> (<a href="/recipes/tags/configuration/">configuration</a>, <a href="/recipes/tags/json/">json</a>, <a href="/recipes/tags/xml/">xml</a>, <a href="/recipes/tags/xmlrpc/">xmlrpc</a>). Revision 2. </p> <p>Many use XML to store configuration data, some use INI files others use Windows Registries and some like JSON. But given the fact that Python is such a powerful language, its easy to create/use such representations. PyDON stands for Python Dictionary Object Notation. It LOOKS similar to JSON but doesn't require you to create any parsers. Plus it can contain Python code which is even better :-).</p> <p>More on this here &gt; <a href="http://lostp.99k.org/files/PyDON.pdf" rel="nofollow">http://lostp.99k.org/files/PyDON.pdf</a></p>