I've been looking for the list Python format characters for a good 30 minutes. I can't find any.
Examples are
%d, %r
etc but I need a list with them along with a开发者_如何学C description if possible please.
Here you go, Python documentation on old string formatting. tutorial -> 7.1.1. Old String Formatting -> "More information can be found in the [link] section".
Note that you should start using the new string formatting when possible.
It's the first result on Google: http://docs.python.org/library/stdtypes.html#string-formatting
See also the new format() function: http://docs.python.org/library/stdtypes.html#str.format
In docs.python.org Topic = 5.6.2. String Formatting Operations http://docs.python.org/library/stdtypes.html#string-formatting then further down to the chart (text above chart is "The conversion types are:")
The chart lists 16 types and some following notes.
My comment: help does not include attitude which is a bonus. The attitude post enabled me to search further and find the info.
精彩评论