import traceback
try: 1/0 except Exception , err: print err
在python3.x中,异常是这样处理的,基类通过关键 词"as" 连接异常类型
try: 1/0 except Exception as err: print(err)