python打印详细的异常信息

1 #!/usr/bin/env python
2 #coding=utf-8
3 import traceback  
4      
5 try:
6     1/0
7 except Exception, e:
8     print e
9     print traceback.format_exc()

 

posted @ 2014-09-25 10:10  siyed  Views(500)  Comments(0Edit  收藏  举报