(self, fmt, sep=' ', ul=None)
@param fmt: list of tuple(heading, key, width)
                        heading: str, column label
                        key: dictionary key to value to print
                        width: int, column width in chars
        @param sep: string, separation between columns
        @param ul: string, character to underline column label, or None for no underlining
def __init__(self, fmt, sep=' ', ul=None):
        """        
        @param fmt: list of tuple(heading, key, width)
                        heading: str, column label
                        key: dictionary key to value to print
                        width: int, column width in chars
        @param sep: string, separation between columns
        @param ul: string, character to underline column label, or None for no underlining
        """
        super(TablePrinter,self).__init__()
        self.fmt   = str(sep).join('{lb}{0}:{1}{rb}'.format(key, width, lb='{', rb='}') for heading,key,width in fmt)
        self.head  = {key:heading for heading,key,width in fmt}
        self.ul    = {key:str(ul)*width for heading,key,width in fmt} if ul else None
        self.width = {key:width for heading,key,width in fmt}
def __init__ ( self , fmt , sep = ' ' , ul = None ) : super ( TablePrinter , self ) . __init__ ( ) self . fmt = str ( sep ) . join ( '{lb}{0}:{1}{rb}' . format ( key , width , lb = '{' , rb = '}' ) for heading , key , width in fmt ) self . head = { key : heading for heading , key , width in fmt } self . ul = { key : str ( ul ) * width for heading , key , width in fmt } if ul else None self . width = { key : width for heading , key , width in fmt }