Class calling functions automatically in Python
This is my current class:
class abc:
def __init__(self, a=0, b=0):
self.c= c
self.b = b
self.a = a
def type_func(self):
type = raw_input("enter the type")
if type == "A":
self.b = 5
else:
self.b = 1
#cab().register()
def input(self):
self.c = int(raw_input("enter c"))
#cab().display()
def display(self):
print self.a,self.b*self.c
c = cab()
I want to call c.type_func()
, and then make the program automatically calls input()
, and when this is done call display()
.
How should I do it?
+3
source to share