What do you want to save?
Add Code snippet
New code examples
-
-
Python 2021-11-07 08:22:09
python get line number of error
import sys, os try: raise NotImplementedError("No error") except Exception as e: exc_type, exc_obj, exc_tb = sys.exc_info() fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1] print(exc_type, fname, exc_tb.tb_lineno) Add solution -
Python 2021-10-28 08:33:24
snowflake python connector error handling
import os import snowflake.connector from snowflake.connector.errors import DatabaseError, ProgrammingError snowflake_account = os.environ['SNOWFLAKE_ACCOUNT'] if __name__ == '__main__': try: con = snowflake.connector.connect( us... Add solution -
Python 2021-10-25 14:47:09
python submit work to redis
# step 1: import the redis-py client package import redis # step 2: define our connection information for Redis # Replaces with your configuration information redis_host = "localhost" redis_port = 6379 redis_password = "" def hello... Add solution -
Python 2021-10-25 04:12:16
What's the difference between a statement and an expression in Python?
#Here’s a general rule of thumb: If you can print it, or assign it to a #variable, it’s an expression. If you can’t, it’s a statement. #Here are some examples of expressions: 2 + 2 3 * 7 1 + 2 + 3 * (8 ** 9) - sqrt(4.0) min(2,... Add solution -
Other 2021-10-17 14:39:09
How make Something like alexa
import os import time import webbrowser from datetime import date import playsound import speech_recognition as sr from gtts import gTTS import wikipedia from datetime import datetime WAKE = 'Sam' def speak111(text): tts = gTTS(text=text, lang=&quo... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5