2024年9月5日
摘要: def outter_1(func1): def inner_1(*args, **kwargs): # 使用不定长参数 print("inner_1内容") func1(*args, **kwargs) print("第一个装饰器 1") return inner_1 def outter_2(f 阅读全文
posted @ 2024-09-05 10:48 boye169 阅读(15) 评论(0) 推荐(0)
摘要: from functools import wraps class logit(object): def __init__(self, logfile='out.log'): self.logfile = logfile def __call__(self, func): @wraps(func) 阅读全文
posted @ 2024-09-05 10:45 boye169 阅读(13) 评论(0) 推荐(0)
摘要: from functools import wraps def logit(logfile='out.log'): def logging_decorator(func): @wraps(func) def wrapped_function(*args, **kwargs): log_string 阅读全文
posted @ 2024-09-05 10:43 boye169 阅读(33) 评论(0) 推荐(0)