I am learning Python. I want to call a function from a String. I made a sample program for this.
class Calling:
def __init__(self,a):
self.Callto(a)
def Callto(self,a):
re=self.Hello(a)
print "Calling= "+re # Here L= CallMe
self.re() # Error is in this line
def Hello(self,a):
b="Me"
return a+b
def CallMe():
print "I am Called"
x=Calling("Call")
Traceback: AttributeError: Calling instance has no attribute 're'
So far what I got is I cant call function with string. What can I do to make this string ('re') callable? Thanks for reading