> For the complete documentation index, see [llms.txt](https://jablack-programs.gitbook.io/python-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jablack-programs.gitbook.io/python-notes/basic-syntax/zhu-jie-decorator.md).

# 注解 Decorator

```python
def hello(fn): 
    def wrapper(): 
        print "hello, %s" % fn.__name__ fn() 
        print "goodby, %s" % fn.__name__ 
    return wrapper
    
    @hello
    def foo(): 
        print "i am foo"foo()
```
