摘要: python-装饰器案例1 高阶函数+嵌套函数=装饰器 例1: import time def timer(func): def deco(): start_time=time.time() func() stop_time=time.time() print("kezi the %s"%(stop 阅读全文
posted @ 2019-12-08 03:02 科子 阅读(234) 评论(0) 推荐(0) 编辑
摘要: python-嵌套函数定义:在函数体内用def定义一个函数,它的作用域只在该函数体内有效。 def outside(): print("int the outside") def inside(): print("in the inside") inside() outside() 打印结果 int 阅读全文
posted @ 2019-12-08 02:03 科子 阅读(247) 评论(0) 推荐(0) 编辑