py3k - format specifier for strings

Carl Trachte janencarl at aznex.net
Tue Sep 4 04:15:37 CEST 2007


Hello.
Python 3.0.a1 has been released.  I'm trying to get the hang of the new
string formatting in the form:

>>> a = "{0}".format(5.66)
>>> a
'5.66'

There are more options in PEP 3101 (fill, alignment, etc.), but I'm having
trouble implementing them.  The doc has not yet been written.  I haven't
consulted the source code yet.

Any help in the way of examples would be appreciated.

Carl T.





More information about the Python-list mailing list