项目场景: a='{"a":{}}'.format(i) 问题描述 发生异常: KeyError 原因分析: 主要是因为format需要识别{来替换 解决方案: 把字符串内的大括号再加一层大括号转义 a='{{"a":{}}}'.format(i)