Skip to content

Instantly share code, notes, and snippets.

@vipul-sharma20
Created March 26, 2016 19:49
Show Gist options
  • Select an option

  • Save vipul-sharma20/1b8a2174451a26344cec to your computer and use it in GitHub Desktop.

Select an option

Save vipul-sharma20/1b8a2174451a26344cec to your computer and use it in GitHub Desktop.
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