aveBHS

Самый полезный скрипт

Jan 7th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. import traceback
  2. import webbrowser
  3. import sys
  4.  
  5. def FindException(search):
  6.     exc_type, exc_obj, tb = sys.exc_info()
  7.     if(search == 'stack'):
  8.         webbrowser.open('https://ru.stackoverflow.com/search?q=' + str(exc_obj) + " [python]", new=1)
  9.     elif(search == 'google'):
  10.         webbrowser.open('https://google.com/search?q=python ' + str(exc_obj), new=1)
  11. try:
  12.     #TODO your code
  13.     i = 2/0
  14. except:
  15.     print(traceback.format_exc())
  16.     if input("Find this exception with StackOverflow? [Y/n] ").upper() == "Y":
  17.         FindException('stack')
  18.         if input("Are you finded the solution, or may be try to find with Google? [Y/n] ").upper() == "Y":
  19.             FindException('google')
Add Comment
Please, Sign In to add comment