[Tutor] Can a method be added to dictionary?

lauren at protopc.com lauren at protopc.com
Fri Nov 20 00:02:41 CET 2009


Hey Gang,

Can a function/method be added to a dictionary like so:

myDictionary = {"string":processString(parameter),
                "string2":processString2(parameter),
                "string3":processString3(parameter)
               }

I am basically interested in doing this with a Combobx Event.
When the user selects an option in my dropdown box (event.GetString())
that matches the string in my dictionary...say "string2" then the method:
processString2(parameter) is executed.

Currently when I get the value of: myDictionary[string2] it is None.

Thanks for your help!
Lauren




More information about the Tutor mailing list