print formatting

vsoler vicente.soler at gmail.com
Sat Mar 13 08:16:52 EST 2010


Hello,

My script contains a print statement:

         print '%40s     %15d' % (k, m)

However,

         1- the string is right adjusted, and I would like it left
adjusted
         2- the number is a decimal number, and I would like it with
the thousands separator and 2 decimals

If possible, the thousands separator and the decimal separator should
use my local settings.

Is there any way to achieve this?



More information about the Python-list mailing list