一次实现所有的效果,哼哼。。。
#!/usr/bin/env python # -*- coding: utf-8 -*- def begin(): print('begin call') def end(): print('end call') def log(func): def test(): def fu(): print('exec function name: %s' % func.__name__) return func() return begin(), fu(), end() return test @log def fc(): print('yes') fc()
输出:
C:\Python34\python.exe E:/Python_projects/testweb/test.py begin call exec function name: fc yes end call
Process finished with exit code 0
Sign in to make a reply
杨飞wb
一次实现所有的效果,哼哼。。。
输出:
C:\Python34\python.exe E:/Python_projects/testweb/test.py begin call exec function name: fc yes end call
Process finished with exit code 0