|   | 1 |  initial version  | 
An example what you can do to get something like an action button:
status = False
def toggle():
    global status
    status = not status
@interact
def _(action=[toggle]):
    action()
    print status
A second example ( putting 'random_number' as string in the selector list creates a labeled button)
def random_number():
    return random()
@interact
def _(action=selector(['random_number'],buttons=True)):
    action = eval(action) 
    print action()
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.