Because the ButtonChooser takes in a separate argument for each key, it's not obvious how to feed it a list. The trick is to make use of a handy bit of python syntax (see 7/8 of the way down for info on the *arguments kind of optional arguments).
For instance:
keys = ['A', 'B', 'C']
bc = ButtonChooser(*[Key(key) for key in keys])
Sunday, August 3, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment