def _get_count_from_last_line(filename, file_type):
 last_line = _get_report_contents(filename, last_line_only=True)
 if (file_type is 'python_complexity'):
  regex = '\\d+.\\d+'
 else:
  regex = '^\\d+'
 try:
  return float(re.search(regex, last_line).group(0))
 except (AttributeError, ValueError):
  return None

def _get_count_from_last_line ( filename , file_type ) : last_line = _get_report_contents ( filename , last_line_only = True ) if ( file_type is 'python_complexity' ) : regex = '\\d+.\\d+' else : regex = '^\\d+' try : return float ( re . search ( regex , last_line ) . group ( 0 ) ) except ( AttributeError , ValueError ) : return None
this will return the number in the last line of a file .