python_装饰器,,装饰器:def wr
python_装饰器,,装饰器:def wr
装饰器:
def wrapper(func): if login(‘kk‘): return func def login(user): if user == ‘kk‘: return True else: print "invalid username"def readirct(url): pass@wrapperdef home(): print "show home page!"home()View Code
python_装饰器
相关内容
- 暂无相关文章
评论关闭