- 博客(1)
- 收藏
- 关注
转载 Python修饰器的使用
Python函数修饰符@的作用是为现有函数增加额外的功能.此文章来谈一谈它在日志记录中起到的很好的作用. 举个例子: import datetime __DEBUG__ = Ture def log(func): if __DEBUG__: print('函数开始于',datetime.datetime.now()) func() if __DEBUG__: ...
2019-09-19 00:21:31
303
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人