curry and compose -- functional language constructs

Nick Perkins nperkins7 at home.com
Wed May 2 04:22:30 EDT 2001


How about using curry for an
instant callback with parameters?


from curry import curry
    ...
    def chg_color(newcolor):
        color = newcolor

    bb = Button(root,
                text='Blue',
                command = curry(chg_color, 'blue'))

    rb = Button(root,
                text='Red',
                command = curry(chg_color, 'red'))

    ...







More information about the Python-list mailing list