Linking Dictionary Values

Sylvain Thenault syt at pegasus.logilab.fr
Fri Aug 24 11:06:09 EDT 2001


On Fri, 24 Aug 2001 09:31:44 -0500, Maan M. Hamze <mmhamze at pleiades.net> wrote:

>Also, is it possible to link a value of a Dictionary key into a Python
>function/procedure?  So, if the key is encountered, a way for the
>functionprocedure to be run.

it's possible:

>>> def test():
...     print 'hello maan'
...
>>> dict={}
>>> dict['key']=test
>>> dict['key']()
hello maan     

Cheers

-- 
Sylvain Thenault

LOGILAB




More information about the Python-list mailing list