Did I find the right examples for you? yes no

All Samples(8)  |  Call(4)  |  Derive(0)  |  Import(4)
rows needs to be a list of dictionaries, all with the same keys. 

        def print_table( rows, override_headers=None, uppercase_headers=True ):
    """ rows needs to be a list of dictionaries, all with the same keys. """
    
    keys = rows[0].keys()
    headers = override_headers or keys
    if uppercase_headers:
        rows = [ dict(zip(keys, map(lambda x: x.upper(), headers))), None ] + rows
    else:
        rows = [ dict(zip(keys, headers)), None ] + rows

    lengths = [ max( len(str(row[k])) for row in rows if hasattr(row, '__iter__') ) for k in keys ]
    template = (' '*4).join( ['{%s:%i}'%(h,l) for h,l in zip(keys, lengths)] )

    for row in rows:
        if type(row) == str:
            print row
        elif row == None:
            print
        else:
            print template.format(**row)
        


src/m/t/mtools-1.1.4/mtools/mloginfo/sections/query_section.py   mtools(Download)
from base_section import BaseSection
 
from mtools.util.profile_collection import ProfileCollection
from mtools.util.grouping import Grouping
from mtools.util.print_table import print_table
 
        table_rows = sorted(table_rows, key=itemgetter('sum'), reverse=True)
        print_table(table_rows, titles, uppercase_headers=False)
        print 
 

src/m/t/mtools-HEAD/mtools/mloginfo/sections/query_section.py   mtools(Download)
from base_section import BaseSection
 
from mtools.util.profile_collection import ProfileCollection
from mtools.util.grouping import Grouping
from mtools.util.print_table import print_table
 
        table_rows = sorted(table_rows, key=itemgetter('sum'), reverse=True)
        print_table(table_rows, titles, uppercase_headers=False)
        print 
 

src/m/t/mtools-1.1.4/mtools/mlaunch/mlaunch.py   mtools(Download)
 
from mtools.util.cmdlinetool import BaseCmdLineTool
from mtools.util.print_table import print_table
from mtools.version import __version__
 
        print_docs.append( None )   
        print         
        print_table(print_docs)
 
 

src/m/t/mtools-HEAD/mtools/mlaunch/mlaunch.py   mtools(Download)
 
from mtools.util.cmdlinetool import BaseCmdLineTool
from mtools.util.print_table import print_table
from mtools.version import __version__
 
        print_docs.append( None )   
        print         
        print_table(print_docs)