装饰器

#-*-coding:utf-8-*-
#__author__ = 王小刀
def w1(main_func):
def outer(request,kargs):
print('before')
main_func(request,kargs)
print('after')
return outer

@w1
def show(request,kargs):
print('show')

show('1','2')
posted @ 2017-09-08 16:09  pop_PY  阅读(86)  评论(0编辑  收藏  举报