2019年6月26日
摘要: import timedef auth(func): def wrapper(*args, **kwargs): username = input('username:').strip() password = input('password:').strip() if username == 'a 阅读全文
posted @ 2019-06-26 16:01 Yihan_07 阅读(660) 评论(0) 推荐(0) 编辑
摘要: 装饰器:本身就是个函数,用来给其他函数增加附加的功能def log(): pass def function(): pass log() def funciton2(): pass log() # 函数的调用装饰器原则:1.不能修改被装饰的函数的源代码2.不能修改被装饰的函数的调用方式3.装饰器对被 阅读全文
posted @ 2019-06-26 12:47 Yihan_07 阅读(227) 评论(0) 推荐(0) 编辑