首页 > 技术文章 > python 让异常名称显示出来

beforeluck-shang 2018-01-19 16:22 原文

  try:

    pass

  except Exception as e:

    print(e)

  import sys

  try:

    pass

  except:

    print(sys.exc_info())

下面有其他的方法:

http://blog.sina.com.cn/s/blog_628cc2b70102wccg.html

 

推荐阅读