Creating custom formatter function

Alan G Isaac alan.isaac at gmail.com
Mon Feb 16 14:47:11 CET 2009


On 2/16/2009 6:50 AM Garrett Cooper apparently wrote:
> I was wondering what the proper means was for formatting
> strings.

http://docs.python.org/library/string.html#string-formatting

http://docs.python.org/library/string.html#template-strings

http://docs.python.org/library/stdtypes.html#string-formatting

As for the last: "values must be a tuple with exactly the number
of items specified by the format string, or a single mapping
object (for example, a dictionary)" unless you need only a
single argument in your format string.

hth,
Alan Isaac



More information about the Python-list mailing list