Chaco is a full-featured plotting package built on Numeric and wxPython. It looks very interesting in its own right, but here’s the thing that caught my eye: MakeMenu.
In the demo script (wxdemo_plot.py), I saw this code:
plot_demo_menu = """
Open | Ctrl-O: self.on_open()
Single page...: self.create_file(None,0)
One canvas per page...: self.create_file(None,1)
One value per page...: self.create_file(None,2)
Exit | Ctrl-Q: self.on_exit()
Undo | Ctrl-Z [menu_undo]: self.undo()
Redo | Ctrl-Y [menu_redo]: self.redo()
#(etc, 30 more lines..)
and then later:
self.menu = chaco.wxMenu.MakeMenu( plot_demo_menu, self )
Very cool: a single string to define an entire menu tree, including the Python code to execute when the item is picked, with the whole menu constructed by a single call with the string.