# 通过正则表达式,给key加上引号# content = re.sub(r'(?<={|,)([a-zA-Z][a-zA-Z0-9]*)(?=:)', r'"\1"', content) # 新数据已经有引号了