Skip to content

Instantly share code, notes, and snippets.

@vovanz
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vovanz/4bcc82eed96513635d62 to your computer and use it in GitHub Desktop.
Save vovanz/4bcc82eed96513635d62 to your computer and use it in GitHub Desktop.
import webbrowser
def google_it(e):
url = r'https://www.google.ru/#q=' + e.__class__.__name__ + ':' + str(e) + '+python'
webbrowser.open(url)
def google_it_for_me(f):
def wrapper(*args, **kwargs):
try:
f(*args, **kwargs)
except Exception as e:
google_it(e)
return wrapper
@google_it_for_me
def f1():
1 / 0
@google_it_for_me
def f3(*pargs):
l = pargs
return l.index(10)
if __name__ == "__main__":
f1()
f3()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment