Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

exception handling in tkinter

# Python program to handle simple runtime error
#Python 3
 
a = [1, 2, 3]
try:
    print ("Second element = %d" %(a[1]))
 
    # Throws error since there are only 3 elements in array
    print ("Fourth element = %d" %(a[3]))
 
except:
    print ("An error occurred")
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #exception #handling #tkinter
ADD COMMENT
Topic
Name
1+6 =