def xl_col_to_name(col_num, col_abs=False):
 col_num += 1
 col_str = ''
 col_abs = ('$' if col_abs else '')
 while col_num:
  remainder = (col_num % 26)
  if (remainder == 0):
   remainder = 26
  col_letter = chr(((ord('A') + remainder) - 1))
  col_str = (col_letter + col_str)
  col_num = int(((col_num - 1) / 26))
 return (col_abs + col_str)

def xl_col_to_name ( col_num , col_abs = False ) : col_num += 1 col_str = '' col_abs = ( '$' if col_abs else '' ) while col_num : remainder = ( col_num % 26 ) if ( remainder == 0 ) : remainder = 26 col_letter = chr ( ( ( ord ( 'A' ) + remainder ) - 1 ) ) col_str = ( col_letter + col_str ) col_num = int ( ( ( col_num - 1 ) / 26 ) ) return ( col_abs + col_str )
convert a zero indexed column cell reference to a string .