Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

MultiDeco

#Python 2.7.17
#MultiDeco
#this code is created by Rezaul Hoque on December 07,2021;contact: jewelmrh@yahoo.com
#note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning;

def Deco1(fun):
     def wrap(*args,**kwargs):
           print("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<")
           print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
           print("Decorator 1")
           fun(*args,**kwargs)
          
           print("December 07,2021")
           print("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<")
           print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
     return wrap

def Deco2(fun):
         def wrap(*args,**kwargs):
                print("Decorator 2")
                print("Python Decorator Example")
                return fun(*args,**kwargs)
         return wrap

@Deco1
@Deco2
def theFun(s1,s2):
       print(s1+" "+s2)

theFun("Multiple","Decorator")


 run  | edit  | history  | help 0