装饰器
Posted khfuu1706165
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了装饰器相关的知识,希望对你有一定的参考价值。
import time user,passwd = ‘alex‘,‘abc123‘ def auth(auth_type): print("auth func:",auth_type) def outer_wrapper(func): print("out_wrapper func:",func) def wrapper(*args, **kwargs): print("wrapper func args:", *args, **kwargs) if auth_type == "local": username = input("Username:").strip() password = input("Password:").strip() if user == username and passwd == password: print("