Popular recipes by Richie Hindle http://code.activestate.com/recipes/users/135761/2001-10-14T09:01:29-07:00ActiveState Code RecipesUsing a simple dictionary for CGI parameters (Python) 2001-10-13T09:51:15-07:00Richie Hindlehttp://code.activestate.com/recipes/users/135761/http://code.activestate.com/recipes/81547-using-a-simple-dictionary-for-cgi-parameters/ <p style="color: grey"> Python recipe 81547 by <a href="/recipes/users/135761/">Richie Hindle</a> (<a href="/recipes/tags/cgi/">cgi</a>). </p> <p>Rather than using Python's cgi.FieldStorage class, a simple dictionary is enough for 99% of CGI scripts. This recipe shows you how to convert a FieldStorage object into a simple dictionary.</p> Allowing the Python profiler to profile C modules (Python) 2001-10-14T09:01:29-07:00Richie Hindlehttp://code.activestate.com/recipes/users/135761/http://code.activestate.com/recipes/81535-allowing-the-python-profiler-to-profile-c-modules/ <p style="color: grey"> Python recipe 81535 by <a href="/recipes/users/135761/">Richie Hindle</a> (<a href="/recipes/tags/debugging/">debugging</a>). Revision 3. </p> <p>This recipe lets you take into account time spent in C modules when profiling your Python code. Normally the profiler only profiles Python code, so finding out how much time is spent accessing a database, running encryption code, sleeping and so on is difficult. Profilewrap makes it easy to profile C code as well as Python code, giving you a clearer picture of where your application is spending its time.</p> <p>Profilewrap demonstrates how to create proxy objects at runtime that intercept calls between pre-existing pieces of code. It also demonstrates the use of the 'new' module to create new functions on the fly.</p>