Fire Method by predefined string!

Tamer Higazi th982a at googlemail.com
Sun Nov 17 22:46:16 CET 2013


Hi people!

Assume we have 2 methods, one called Fire and the other __DoSomething.

I want the param which is a string to be converted, that I can fire
directly a method. Is it somehow possible in python, instead of writing
if else statements ???!



Tamer


class(object):
    def Fire(self,param)
        #possible ?!
        self.__param():


    def _DoSomething(self):
        print 'I did it!'



More information about the Python-list mailing list