The SoCal Piggies had their sixth meeting at USC on August 16th at 7:00 PM. A record number of 8 Piggies attended -- Daniel Arbuckle, Diane Trout, Steve Williams, George Bullis, Grig Gheorghiu, Mark Kohler, Howard Golden and Brian Leair.
Steve Williams showed us a demo of a commercial wxPython/Firebird application he created. The application, written when Python was at version 2.2, targets vocational schools and provides a very intuitive GUI for managing information about students/classes/counselors/etc. Steve talked about some of the issues he faced when writing the app, most of them due to the sheer amount of wxWindows documentation that he had to go through in order to solve particular problems. One such issue is printing various reports which need to be scaled differently based on whether they're displayed on the screen or sent to a printer. One cool thing the app offers is the capability to create custom reports on the fly by choosing items to be displayed, along with their sort order.
Steve spent some time going through the code for the "Student" screen and showing how wxPython provides a lot of functionality in a few lines of Python code. The application makes heavy use of grids, so that GUI elements are properly aligned on the screen regardless of display, resizing, etc. Steve had words of praise about Firebird, especially about its support of stored procedures and its cross-platform capabilities. As an aside, a demo version of the application + database (using the Embedded version of Firebird) can be run from a USB flash memory card!
Daniel Arbuckle was next, and he gave us a quick overview of [http://highenergymagic.org/presentations/sets_etc sets and decorators]. Sets are very handy when implementing algorithms (for example in [http://en.wikipedia.org/wiki/Graph_theory graph theory]), but they can be used whenever you need to make sure lists don't have duplicates. You might have used dictionaries where None values specify that the key is not part of a collection. Well, you can do this much easier with sets.
Daniel continued his talk by showing some common usage patters for decorators, in particular the more complicated case where the decorator function takes parameters (see the 'foobified' function on the last slide). He exemplified such a decorator function by writing a 'prelog' decorator that can be used to log stuff before the 'decorated' function executes. According to Daniel, decorators allowed him to eliminate redundancy in his code by factoring out common code chunks that used to live at the start or at the end of multiple functions -- he moved them out into decorators and now they're in one place. Remember, stay [http://www.artima.com/intv/dry.html DRY]!
Many thanks to Steve and Daniel for presenting and to Diane for bringing the projector.
The next meeting will be at USC again. Topics for next meeting:
- PIL overview (Brian Leair)
- matplotlib tutorial (Diane Trout)
