def get_fontsize(numrows):
 thresholds = [25, 50, 75, 100, 125]
 sizes = [5, 4, 3, 2, 1.5, 1]
 i = 0
 while (numrows > thresholds[i]):
  i += 1
  if (i == len(thresholds)):
   break
 return sizes[i]

def get_fontsize ( numrows ) : thresholds = [ 25 , 50 , 75 , 100 , 125 ] sizes = [ 5 , 4 , 3 , 2 , 1.5 , 1 ] i = 0 while ( numrows > thresholds [ i ] ) : i += 1 if ( i == len ( thresholds ) ) : break return sizes [ i ]
returns the fontsize needed to make text fit within each row .