def get_last_line(txt):
 lines = txt.split('\n')
 n = (len(lines) - 1)
 while ((n >= 0) and (not lines[n].strip('\r DCTB  '))):
  n = (n - 1)
 line = lines[n].strip('\r DCTB  ')
 if (len(line) >= 150):
  line = (line[:147] + '...')
 return line

def get_last_line ( txt ) : lines = txt . split ( '\n' ) n = ( len ( lines ) - 1 ) while ( ( n >= 0 ) and ( not lines [ n ] . strip ( '\r DCTB  ' ) ) ) : n = ( n - 1 ) line = lines [ n ] . strip ( '\r DCTB  ' ) if ( len ( line ) >= 150 ) : line = ( line [ : 147 ] + '...' ) return line
return last non-empty line of a text .