def print(self, end_offset=0):
        """

        :param end_offset:  0 means print all, 1 means print parts[:-1] etc
        :return:
        """
        # note that the kwarg `tb_offset` of the FormattedTB constructor is refers to the start of the list
        tb_parts = self.TB.structured_traceback(self.excType, self.excValue, self.traceback)
        text = "\n".join(tb_parts[:len(tb_parts)-1-end_offset]+[tb_parts[-1]])
        print(text)
def print ( self , end_offset = 0 ) : tb_parts = self . TB . structured_traceback ( self . excType , self . excValue , self . traceback ) text = "\n" . join ( tb_parts [ : len ( tb_parts ) - 1 - end_offset ] + [ tb_parts [ - 1 ] ] ) print ( text )
:param end_offset:  0 means print all, 1 means print parts[:-1] etc
        :return: