Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import traceback
- import webbrowser
- import sys
- def FindException(search):
- exc_type, exc_obj, tb = sys.exc_info()
- if(search == 'stack'):
- webbrowser.open('https://ru.stackoverflow.com/search?q=' + str(exc_obj) + " [python]", new=1)
- elif(search == 'google'):
- webbrowser.open('https://google.com/search?q=python ' + str(exc_obj), new=1)
- try:
- #TODO your code
- i = 2/0
- except:
- print(traceback.format_exc())
- if input("Find this exception with StackOverflow? [Y/n] ").upper() == "Y":
- FindException('stack')
- if input("Are you finded the solution, or may be try to find with Google? [Y/n] ").upper() == "Y":
- FindException('google')
Add Comment
Please, Sign In to add comment