Dear Kent,

>>You can look up the function in the globals() dict, or you can import
>>__main__, which is the top-level module, and use getattr() on it. Or you
>>could wrap your functions in a class...
>>
>>def OnMenuFindMe():
>>    print 'You found me'
>>
>>f = globals()['OnMenuFindMe']
>>
>>f()
>>
>>import __main__
>>
>>g = getattr(__main__, 'OnMenuFindMe')
>>g()
>>
>>Kent

Many thanks.


Yours sincerely,
______________________________
János Juhász

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to