2018年7月20日

装饰器案例2

摘要: #!\usr\bin\env\python # -*- coding:utf-8 -*9 import time user,passwd='alex','abc123' #写定账户密码 def auth(auth_type): #定义装饰器函数 print("auth func :",auth_ty 阅读全文

posted @ 2018-07-20 11:47 凛冬08 阅读(92) 评论(0) 推荐(0) 编辑

装饰器案例1:

摘要: #!\usr\bin\env\python # -*- coding:utf-8 -*9 import time def timer(func): #定义装饰器函数 def deco(*args,**kwargs): #定义嵌套函数 start_time=time.time() func(*args 阅读全文

posted @ 2018-07-20 11:11 凛冬08 阅读(76) 评论(0) 推荐(0) 编辑

导航