code: def _print_table(rows, header=True):
      
      border = "="
      # vertical delimiter
      vdelim = " | "
      # padding nr. of spaces are left around the longest element in the
      # column
      padding = 1
      # may be left,center,right
      justify = 'right'
      justify = {'left'   : str.ljust,
                 'center' : str.center,
                 'right'  : str.rjust}[justify.lower()]
      # calculate column widths (longest item in each col
      # plus "padding" nr of spaces on both sides)
      cols = zip(*rows)
      colWidths = [max([len(str(item))+2*padding for item in col]) for col in cols]
      borderline = vdelim.join([w*border for w in colWidths])
      for row in rows:
          print(vdelim.join([justify(str(item),width) for (item,width) in zip(row,colWidths)]))
          if header:
              print(borderline)
              header=False
docs: Print a list of lists as a pretty table.
  
      Keyword arguments:
      header -- if True the first row is treated as a table header
  
      inspired by http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/267662