摘要: *****装饰器攻坚前置任务 # 1. *args, **kwargs def index(x, y): print(x, y) def wrapper(*args, **kwargs): index(*args, **kwargs) # 1.wrapper传的实参是什么形式会原封不动的传到inde 阅读全文
posted @ 2020-03-23 21:45 清轩挽长风 阅读(162) 评论(0) 推荐(0) 编辑
摘要: # 一:编写函数,(函数执行的时间用time.sleep(n)模拟) import time def index(): time.sleep(3) print('工具人') # 二:编写装饰器,为函数加上统计时间的功能 import time def timeer(func): def upper( 阅读全文
posted @ 2020-03-23 20:29 清轩挽长风 阅读(111) 评论(0) 推荐(0) 编辑