标签:nbsp pen rac open 异常 bsp file err print
try:
  xxxx
except Exception as e:
  print(e)
#此处返回的只是一个异常错误  
import  traceback
try:
  xxxx
except:
  traceback.print_exc()      #可以加参数写成报错日志 traceback.print_exc(file=open(‘error.txt‘,‘a‘))
#可以提示 准确在哪一行有错误 
标签:nbsp pen rac open 异常 bsp file err print
原文地址:https://www.cnblogs.com/zxs117/p/12807431.html