python 代码片段21
2016-01-04 22:53
761 查看
#coding=utf-8 @doco def foo(): pass ''' deco把foo函数拿过来,加上一些额外的功能再重新赋值给foo,如下 ''' foo=deco(foo) def log(func): def wrappedFunc(): print "*** %s() called" % func.__name__ return func() return wrappedFunc @log def foo(): print "inside foo()" foo()
相关文章推荐
- python实现批量注册网站用户
- Python: How to iterate list in reverse order
- 【极客学院】-python学习笔记-2-Python特色,学习路线
- python入门(二)
- python 编程小实例(2) 四则运算小游戏
- 如何搭建Python3.4+Selenium
- python爬虫写文件编码
- gnuradio的Python应用中绘图
- python 代码片段20
- python 代码片段19
- python 代码片段18
- 10. Regular Expression Matching leetcode Python 2016 new Season
- python 代码片段17
- sublime text帮你更好的写python
- python基础:映射和集合类型
- python 代码片段15
- python 代码片段14
- python正则表达式去除两个特殊字符间的内容
- python 代码片段13
- python 代码片段12