def colnum2name(n):
 assert (n > 0)
 s = ''
 while n:
  (n, m) = divmod((n - 1), 26)
  s = (chr((m + ord('A'))) + s)
 return s

def colnum2name ( n ) : assert ( n > 0 ) s = '' while n : ( n , m ) = divmod ( ( n - 1 ) , 26 ) s = ( chr ( ( m + ord ( 'A' ) ) ) + s ) return s
translate a column number to name .