Python "{}.format()" 输出格式化方法
Python “{}.format()” 输出格式化方法 在Python中输入 help('FORMATTING') 可以得到完整的帮助文档如下 ......................显示为部分内容................................ The grammar for a replacement field is as follows: replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}" field_name ::= arg_name ("." attribute_name | "[" element_index "]")* arg_name ::= [identifier | digit+] attribute_name ::= identifier element_index ::= digit+ | index_string index_string ::= <any source character except "]"> + conversion ::= "r" | "s" | "a" format_spec ::= <described in the next section> .............................