HI I am new to jupyter notebook. I am not sure why this block of 开发者_开发问答code executes both try and except in my code
print('time :' , datetime.now())
try:
print("Command executed")
pd.read_sql('''select * from table ''')
print("Command executed")
except:
print("Command skipped")
Here is the output I am getting
time : 2022-12-07 06:40:37.294965
Command executed
Command skipped
You check points should be different..You alredy used Command executed ...user different check point after query to see diffrence.
print('time :' , datetime.now())
try:
print("Execution started")
pd.read_sql('''select * from table ''')
print("Command executed")
except:
print("Command skipped")
精彩评论