这段代码的逻辑没有问题,可以正确地给 JSON 中的'type'为'account'的元素添加'mcas_username'键值对,并将修改后的 JSON 字符串加入到'results'中。

if i['type'] == 'account':
    i['mcas_username'] = i['label']
    i = str(i).replace("'","\"")
    results += i + 'delimiterDelimiter'
Python JSON 添加 'account' 元素属性的正确方法

原文地址: https://www.cveoy.top/t/topic/hBO7 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录