curry and compose -- functional language constructs

Nick Perkins nperkins7 at home.com
Wed May 2 10:22:30 CEST 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