Python自定义异常

2016.07.31, Python ,抢沙发,1678人打酱油
#!/usr/bin/python # -*- coding: utf-8 -*- # Filename: usingException.py # 异常处理 # 写一个自己定义的异常类 class MyInputException(Exception): def __init__(self, length, least): E...

[转]Python异常处理

2016.07.31, Python ,抢沙发,1566人打酱油
#!/usr/bin/python import traceback try:  1/0 #except Exception,e: # print traceback.format_exc()    except Exception as e:  print e #!...