[Tutor] Displaying data in columns

Prasad, Ramit ramit.prasad at jpmorgan.com
Tue May 8 18:11:38 CEST 2012


> > I would like to display some of the items in the tuples in columnar
> > format with each column lining up on the left side (below should be
> > three neat columns with location, training type, number trained and
> > date):
> 
> You need to read up on string formatting. That allows you to specify the
> length of fields, whether they are left or right justified, any leading
> pad characters etc. This is not in a module but is a standard feature of
> Python.
> 
> 
> For anything more exotic you should look to a formatting language
> like HTML.
> 
>

You have already gotten links for string interpolation. There is the
link for string formatting.
http://docs.python.org/library/string.html#format-string-syntax 

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  


More information about the Tutor mailing list