Python 自定义异常
Python 自定义异常
#1.用户自定义异常类型 class TdmsFileMissedExceptin(Exception): "this is user's Exception for check the length of name " def __init__(self,path): self.path = path def __str__(self): print("The tdms files in "+str(self.path)+"is missed!")