标签:
class myexception(Exception):
def __init__(self,value):
self.value = value
self.message =‘myexception error‘
def say():
#name=‘FreeMan‘
try:
raise myexception(‘test‘)
‘‘‘
#print name
#print ‘hello world!‘
except NameError as e :
print Exception,e
print e.message
except ArithmeticError as a :
print a.message
‘‘‘
except Exception,e:
print e.message
# print ‘unknow yichang‘
else:
print "Has name"
finally:
print ‘get to finally‘
say()
标签:
原文地址:http://www.cnblogs.com/yjz1/p/5367881.html