Last active
August 29, 2015 14:19
-
-
Save vovanz/4bcc82eed96513635d62 to your computer and use it in GitHub Desktop.
This file contains 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
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