Calling a function or method by name

Eric Brunel eric.brunel at pragmadev.com
Wed Jan 23 11:14:47 EST 2002


> I want to use a dict. The keys will be the value of the key being pressed.
> The values will be the name of the function to call.

Why don't you directly store the methods themselves instead of their names? 
Then, you'll just have to do:
dict[key]()

 - eric -



More information about the Python-list mailing list