类似于%s。括号内的部分是可选的。在The only difference is that, for the first one, your values must be a
tuple with exactly the number of items specified by the format string,
and for the 2nd one, it must be a single mapping object (for example,
a dictionary)A conversion specifier contains two or more characters and has the
following components, which must occur in this order:The '%' character, which marks the start of the specifier.
Mapping key (optional), consisting of a parenthesised sequence of characters (for
example, (somename)).
.. and there are some more
同时:When the right argument is a dictionary (or other mapping type), then
the formats in the string must include a parenthesised mapping key
into that dictionary inserted immediately after the '%' character. The
mapping key selects the value to be formatted from the mapping
文件中的一个例子:>>> print '%(language)s has %(number)03d quote types.' % \
... {"language": "Python", "number": 2}
Python has 002 quote types.
因此,在%之后和{}之前()内的文本在字典中是key。在