What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-18 16:09:03
python email exception error
#This gives feedback on errors within a script which then emails output import win32com.client import os import sys try: #Some code except Exception as e: exc_type, exc_obj, exc_tb = sys.exc_info() fname = os.path.split(exc_tb.tb_frame.f_co... Add solution -
Python 2021-09-13 11:40:02
python check if website is reachable
import requests URL = "https://api.github.com" try: response = requests.head(URL) except Exception as e: print(f"NOT OK: {str(e)}") else: if response.status_code == 200: print("OK") else: pri... Add solution -
Python 2021-09-10 14:59:02
stopiteration error python
# When an iterator is done, it’s next method raises StopIteration. This exception is # not considered an error. We re-write the given code as follows to catch the # exception and know its type. Example import sys try: z = [5, 9, 7] i = iter(z) pr... Add solution -
Python 2021-09-10 07:28:01
finding all vowels in a string python
def find_all_vowels(Word: str): if Word == None or Word == "": raise Exception("The arguments 'Word' is None or empty") vowles_in_Word = [] Word = Word.upper() Vowles_list = ["A","E","I&... Add solution
Best helpers
Eric Vought
+5
James Song
+5
Fishbean
+5
Mai Rose
+5
Bunch
+5
Bob R Bogle
+5
Gruppetto
+5
Katboodle
+5
Vidhi Patel
+5
Buttercup
+5
Bin Nguyễn
+5