파이썬 Decoratior

Decorator 1 어떤 함수에 있는 핵심코드를 수행하기 이전과 이후에 뭔가 작업을 하고 싶어 스프링 AOP 적용과 비슷하게 작업을 할수 있는게 Decorator 야 123456789101112131415161718192021222324252627282930#-*- coding: utf-8 -*-''' - decorator 학습하기''' def helloBye(func): def wrapper(): print "hello!" # helloBye 의 인자로 전달된 함수를 호출 func() print "bye!" return wrapper @helloByedef f1(): print u"f1() 함수를 수행했습니다."@helloByedef f2(): print u"f2() 함수를 수행했습니다."@hello..
- 광속거북이 -
'파이썬 Decoratior' 태그의 글 목록