I want to call multiple modules using for loop in paintEvent(), like
def fun1(self,paint,a,b):
do something ...
def fun2(self,paint,a,b):
do something ...
def fun3(self,paint,a,b):
do something ....
def paintEvent(self,event=None):
for i in range (1,3):
self.fun[i](self,paint,a,b)
basically my fun1, fun2 and fun3 are drawing some widgets and are almost same. Please help me how to call these functions using for loop.
You could do something like:
If fun1, fun2, and fun3 are almost the same thing as you have said, you should consider combining them into one function that you can call with an additional argument.