Created
March 26, 2016 19:49
-
-
Save vipul-sharma20/1b8a2174451a26344cec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def p_decorate(func): | |
| def func_wrapper(name): | |
| return "<p>{0}</p>".format(func(name)) | |
| return func_wrapper | |
| @p_decorate | |
| def get_text(name): | |
| return "lorem ipsum, {0} dolor sit amet".format(name) | |
| print get_text("Vipul") | |
| # Output: | |
| # <p>lorem ipsum, Vipul dolor sit amet</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment