Popular recipes by Brian McErlean http://code.activestate.com/recipes/users/111980/2008-09-25T11:23:29-07:00ActiveState Code RecipesDebugging a running python process by interrupting and providing an interactive prompt (Python) 2008-09-25T11:23:29-07:00Brian McErleanhttp://code.activestate.com/recipes/users/111980/http://code.activestate.com/recipes/576515-debugging-a-running-python-process-by-interrupting/ <p style="color: grey"> Python recipe 576515 by <a href="/recipes/users/111980/">Brian McErlean</a> (<a href="/recipes/tags/debug/">debug</a>, <a href="/recipes/tags/interactive/">interactive</a>, <a href="/recipes/tags/remote/">remote</a>, <a href="/recipes/tags/signal/">signal</a>). Revision 2. </p> <p>This provides code to allow any python program which uses it to be interrupted at the current point, and communicated with via a normal python interactive console. This allows the locals, globals and associated program state to be investigated, as well as calling arbitrary functions and classes.</p> <p>To use, a process should import the module, and call listen() at any point during startup. To interrupt this process, the script can be run directly, giving the process Id of the process to debug as the parameter.</p> A higher level struct module (Python) 2006-10-26T14:47:57-07:00Brian McErleanhttp://code.activestate.com/recipes/users/111980/http://code.activestate.com/recipes/498149-a-higher-level-struct-module/ <p style="color: grey"> Python recipe 498149 by <a href="/recipes/users/111980/">Brian McErlean</a> (<a href="/recipes/tags/database/">database</a>). Revision 4. </p> <p>This recipe provides a higher level wrapper around the struct module. It provides a more convenient syntax for defining and using structs, and adds additional features such as: - Allows embedding structures within other structures - Allows defining arrays of items (or other structures) - Class based syntax, allowing access and updates by field name, not position - Extension of structures by inheritance</p> Building GTK GUIs interactively (Python) 2001-09-27T15:49:21-07:00Brian McErleanhttp://code.activestate.com/recipes/users/111980/http://code.activestate.com/recipes/65109-building-gtk-guis-interactively/ <p style="color: grey"> Python recipe 65109 by <a href="/recipes/users/111980/">Brian McErlean</a> (<a href="/recipes/tags/ui/">ui</a>). Revision 3. </p> <p>One of pythons greatest strengths is the ability to try things interactively at the interpreter. Using Tkinter shares this strength, since one can create buttons, windows and other widgets, and instantly see them onscreen, click on buttons to activate callbacks and still be able to edit and add to the widgets from the python command line.</p> <p>While the python GTK bindings are generally excellent, one of their flaws is that this is not possible. Before anything is actually displayed, the gtk.mainloop() function must be called, ending the possibility of interactive manipulation.</p> <p>This recipe is a program which simulates a python interpreter which transparently allows the user to use gtk widgets without having to call mainloop(), in much the same way as Tk widgets.</p> <p>This latest version contains enhancements added by Christian Robottom Reis to add readline completion support.</p>