So, thanks to traits, our class definition looks quite clean, and we can provide some manifest typing as well. I show a screen shot of my ipython session, which was launched with
ipython -wthread
:So executing line [5] pops up the GUI shown. One nice thing about traits is the built-in MVC architecture, which allows me to change the value in the
choices
class attribute and it informs the listening label
, which is updated automatically. Notice that the value f.choices
inspected at the command line is updated as well:
The main drawback I see between this approach and Richard's is the size of the tool chain. The TraitsGUI piece requires wxPython (or QT--it works with either), and some dependencies.
No comments:
Post a Comment